From 35a382e8142bbc4f5e41191a3a9ac9d7d8e06e6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Lucas=20Lucchetta?= Date: Fri, 21 Aug 2020 18:11:38 -0300 Subject: [PATCH] doc: add Windows-specific info to subprocess.kill() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Clarify the inner workings of .kill on Windows, since termination signals are not available there. Fixes: https://github.com/nodejs/node/issues/34858 PR-URL: https://github.com/nodejs/node/pull/34867 Reviewed-By: Juan José Arboleda Reviewed-By: James M Snell Reviewed-By: Rich Trott --- doc/api/child_process.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/api/child_process.md b/doc/api/child_process.md index 54aea5abbef15b..ff8a0b7da8d358 100644 --- a/doc/api/child_process.md +++ b/doc/api/child_process.md @@ -1203,6 +1203,11 @@ may not actually terminate the process. See kill(2) for reference. +On Windows, where POSIX signals do not exist, the `signal` argument will be +ignored, and the process will be killed forcefully and abruptly (similar to +`'SIGKILL'`). +See [Signal Events][] for more details. + On Linux, child processes of child processes will not be terminated when attempting to kill their parent. This is likely to happen when running a new process in a shell or with the use of the `shell` option of `ChildProcess`: @@ -1667,6 +1672,7 @@ or [`child_process.fork()`][]. [Default Windows shell]: #child_process_default_windows_shell [HTML structured clone algorithm]: https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm [Shell requirements]: #child_process_shell_requirements +[Signal Events]: process.md#process_signal_events [`'disconnect'`]: process.md#process_event_disconnect [`'error'`]: #child_process_event_error [`'exit'`]: #child_process_event_exit