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 <info@bnoordhuis.nl>
This commit is contained in:
Vladimír Čunát 2018-09-13 17:30:59 +02:00 committed by Ben Noordhuis
parent 598a49b942
commit 4fc5a0ee61

View File

@ -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
----------