From 4fc5a0ee61168565bd94864c9cd68379bb5454f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Thu, 13 Sep 2018 17:30:59 +0200 Subject: [PATCH] doc: describe unix signal handling better - SIGTERM seems OK to handle - I tested that on Linux, read POSIX, etc. I can't see why it should be different from SIGUSR1, for example, except that the default handler is different. - Also raise(15) is caught by the handler for me, and I can't see why it wouldn't. The main source of knowledge for this is POSIX. http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_04_03_03 PR-URL: https://github.com/libuv/libuv/pull/1987 Reviewed-By: Ben Noordhuis --- docs/src/signal.rst | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/docs/src/signal.rst b/docs/src/signal.rst index f52b6470..f5a809ab 100644 --- a/docs/src/signal.rst +++ b/docs/src/signal.rst @@ -6,7 +6,10 @@ Signal handles implement Unix style signal handling on a per-event loop bases. -Reception of some signals is emulated on Windows: +Windows notes +------------- + +Reception of some signals is emulated: * SIGINT is normally delivered when the user presses CTRL+C. However, like on Unix, it is not generated when terminal raw mode is enabled. @@ -24,13 +27,22 @@ Reception of some signals is emulated on Windows: * Calls to raise() or abort() to programmatically raise a signal are not detected by libuv; these will not trigger a signal watcher. -.. note:: - On Linux SIGRT0 and SIGRT1 (signals 32 and 33) are used by the NPTL pthreads library to - manage threads. Installing watchers for those signals will lead to unpredictable behavior - and is strongly discouraged. Future versions of libuv may simply reject them. - .. versionchanged:: 1.15.0 SIGWINCH support on Windows was improved. +Unix notes +---------- + +* SIGKILL and SIGSTOP are impossible to catch. + +* Handling SIGBUS, SIGFPE, SIGILL or SIGSEGV via libuv results into undefined behavior. + +* SIGABRT will not be caught by libuv if generated by `abort()`, e.g. through `assert()`. + +* On Linux SIGRT0 and SIGRT1 (signals 32 and 33) are used by the NPTL pthreads library to + manage threads. Installing watchers for those signals will lead to unpredictable behavior + and is strongly discouraged. Future versions of libuv may simply reject them. + + Data types ----------