Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I handle SIGINT in Erlang?

I know how to create custom signal handlers in Java, Python, Ruby, Perl, and Lisp, thanks to Google and a plethora of tutorials. I can't find online how to create handlers for SIGINT, SIGTERM, HUP, etc. in Erlang.

like image 721
mcandre Avatar asked Feb 23 '11 08:02

mcandre


People also ask

How do you SIGINT?

The SIGINT signal is sent to a process by its controlling terminal when a user wishes to interrupt the process. This is typically initiated by pressing Ctrl-C, but on some systems, the "delete" character or "break" key can be used. The SIGKILL signal is sent to a process to cause it to terminate immediately (kill).

What signal is SIGINT?

SIGINT is the signal sent when we press Ctrl+C. The default action is to terminate the process. However, some programs override this action and handle it differently. One common example is the bash interpreter.

Is SIGINT an interrupt?

The SIGINT (“program interrupt”) signal is sent when the user types the INTR character (normally C-c ).


1 Answers

You can not. OS signals handled exclusively by Erlang VM. I guess OS signals can be handled in a driver but it can interfere with the VM signal handler so use it on your own risk.

like image 134
hdima Avatar answered Nov 09 '22 21:11

hdima