Skip to content

Commit e33e989

Browse files
sam-githubtargos
authored andcommittedApr 22, 2020
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: #32079 Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
1 parent 5b2f698 commit e33e989

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed
 

‎doc/api/process.md

+11-5
Original file line numberDiff line numberDiff line change
@@ -486,11 +486,17 @@ process.on('SIGTERM', handle);
486486
the process hanging in an endless loop, since listeners attached using
487487
`process.on()` are called asynchronously and therefore unable to correct the
488488
underlying problem.
489-
490-
Windows does not support sending signals, but Node.js offers some emulation
491-
with [`process.kill()`][], and [`subprocess.kill()`][]. Sending signal `0` can
492-
be used to test for the existence of a process. Sending `SIGINT`, `SIGTERM`,
493-
and `SIGKILL` cause the unconditional termination of the target process.
489+
* `0` can be sent to test for the existence of a process, it has no effect if
490+
the process exists, but will throw an error if the process does not exist.
491+
492+
Windows does not support signals so has no equivalent to termination by signal,
493+
but Node.js offers some emulation with [`process.kill()`][], and
494+
[`subprocess.kill()`][]:
495+
* Sending `SIGINT`, `SIGTERM`, and `SIGKILL` will cause the unconditional
496+
termination of the target process, and afterwards, subprocess will report that
497+
the process was terminated by signal.
498+
* Sending signal `0` can be used as a platform independent way to test for the
499+
existence of a process.
494500

495501
## `process.abort()`
496502
<!-- YAML

0 commit comments

Comments
 (0)
Please sign in to comment.