doc: clarify Windows signal sending emulation

This commit is contained in:
Sam Roberts 2014-01-15 14:40:58 -08:00 committed by Timothy J Fontaine
parent 67e9298fb6
commit abe02553f2

View File

@ -96,9 +96,9 @@ Note:
`SIGHUP` is to terminate node, but once a listener has been installed its `SIGHUP` is to terminate node, but once a listener has been installed its
default behaviour will be removed. default behaviour will be removed.
- `SIGTERM` is not supported on Windows, it can be listened on. - `SIGTERM` is not supported on Windows, it can be listened on.
- `SIGINT` is supported on all platforms, and can usually be generated with - `SIGINT` from the terminal is supported on all platforms, and can usually be
`CTRL+C` (though this may be configurable). It is not generated when terminal generated with `CTRL+C` (though this may be configurable). It is not generated
raw mode is enabled. when terminal raw mode is enabled.
- `SIGBREAK` is delivered on Windows when `CTRL+BREAK` is pressed, on non-Windows - `SIGBREAK` is delivered on Windows when `CTRL+BREAK` is pressed, on non-Windows
platforms it can be listened on, but there is no way to send or generate it. platforms it can be listened on, but there is no way to send or generate it.
- `SIGWINCH` is delivered when the console has been resized. On Windows, this will - `SIGWINCH` is delivered when the console has been resized. On Windows, this will
@ -108,6 +108,12 @@ Note:
node on all platforms. node on all platforms.
- `SIGSTOP` cannot have a listener installed. - `SIGSTOP` cannot have a listener installed.
Note that Windows does not support sending Signals, but node offers some
emulation with `process.kill()`, and `child_process.kill()`:
- Sending signal `0` can be used to search for the existence of a process
- Sending `SIGINT`, `SIGTERM`, and `SIGKILL` cause the unconditional exit of the
target process.
## process.stdout ## process.stdout
A `Writable Stream` to `stdout`. A `Writable Stream` to `stdout`.
@ -422,7 +428,7 @@ An example of the possible output looks like:
Send a signal to a process. `pid` is the process id and `signal` is the Send a signal to a process. `pid` is the process id and `signal` is the
string describing the signal to send. Signal names are strings like string describing the signal to send. Signal names are strings like
'SIGINT' or 'SIGHUP'. If omitted, the signal will be 'SIGTERM'. 'SIGINT' or 'SIGHUP'. If omitted, the signal will be 'SIGTERM'.
See kill(2) for more information. See [Signal Events](#process_signal_events) and kill(2) for more information.
Will throw an error if target does not exist, and as a special case, a signal of Will throw an error if target does not exist, and as a special case, a signal of
`0` can be used to test for the existence of a process. `0` can be used to test for the existence of a process.