# How to interrupt a long-running ccall C/C++ library?

**URL:** https://discourse.julialang.org/t/how-to-interrupt-a-long-running-ccall-c-c-library/103145
**Category:** General Usage
**Tags:** question, ccall
**Created:** [August 24, 2023, 8:33am UTC](https://discourse.julialang.org/t/how-to-interrupt-a-long-running-ccall-c-c-library/103145 "2023-08-24T08:33:37Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![physcxia](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/physcxia/32/47816_2.png) [@physcxia](https://discourse.julialang.org/u/physcxia)
#### Post date: [August 24, 2023, 8:33am UTC](https://discourse.julialang.org/t/how-to-interrupt-a-long-running-ccall-c-c-library/103145/1 "2023-08-24T08:33:37Z")

</div>

How can I interrupt a ccall C/C++ function with Ctrl-C, or interrupt it in Jupyter Notebook?  
It seems that the Keyboard Interrupt is not passed to the external C library.

---

<div class="post-metadata">

### Author: ![vchuravy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vchuravy/32/8_2.png) [@vchuravy](https://discourse.julialang.org/u/vchuravy)
#### Post date: [August 24, 2023, 5:02pm UTC](https://discourse.julialang.org/t/how-to-interrupt-a-long-running-ccall-c-c-library/103145/2 "2023-08-24T17:02:10Z")

</div>

It depends… Julia installs it’s own interrupt handlers and we currently don’t provide a facility for [signal chaining](https://docs.oracle.com/javase/8/docs/technotes/guides/troubleshoot/signals003.html).  
Although we should!

So if your C++ library installs its own signal handler, most likely the Julia one will be called instead.
