How can I handle SIGINT in Erlang?
Asked Answered
G

2

11

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.

Grilse answered 23/2, 2011 at 8:36 Comment(0)
J
8

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.

Jennifer answered 23/2, 2011 at 15:57 Comment(1)
I'm sad to hear that, but at least I know that now. I just wish I could save to disk before Control + C threatens my programs.Grilse
N
3

I stumbled upon this: http://erlang.org/doc/man/kernel_app.html#erl_signal_server. I have not seen it formally announced anywhere, but I might have missed the announcement.

Novice answered 7/7, 2018 at 9:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.