doc: clarify windows specific behaviour

It was not possible to understand which, if either, of the sentences
after the first ("Windows does not... emulation") apply specifically to
Windows.  Specifically, `kill(pid, 0)` works on Linux and Windows and I
couldn't find it documented anywhere else, but the unconditional
termination occurs only on Windows.

PR-URL: https://github.com/nodejs/node/pull/32079
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This commit is contained in:
Sam Roberts authored and Michaël Zasso committed 2020-04-22 17:39:21 +02:00
1 parent 5b2f698b32
commit e33e989f20
1 file changed
+10 -4
+10 -4
View File
@@ -486,11 +486,17 @@ process.on('SIGTERM', handle);
the process hanging in an endless loop, since listeners attached using
`process.on()` are called asynchronously and therefore unable to correct the
underlying problem.
* `0` can be sent to test for the existence of a process, it has no effect if
the process exists, but will throw an error if the process does not exist.
Windows does not support sending signals, but Node.js offers some emulation
with [`process.kill()`][], and [`subprocess.kill()`][]. Sending signal `0` can
be used to test for the existence of a process. Sending `SIGINT`, `SIGTERM`,
and `SIGKILL` cause the unconditional termination of the target process.
Windows does not support signals so has no equivalent to termination by signal,
but Node.js offers some emulation with [`process.kill()`][], and
[`subprocess.kill()`][]:
* Sending `SIGINT`, `SIGTERM`, and `SIGKILL` will cause the unconditional
termination of the target process, and afterwards, subprocess will report that
the process was terminated by signal.
* Sending signal `0` can be used as a platform independent way to test for the
existence of a process.
## `process.abort()`
<!-- YAML