1 | // This is not the set of all possible signals.
|
2 | //
|
3 | // It IS, however, the set of all signals that trigger
|
4 | // an exit on either Linux or BSD systems. Linux is a
|
5 | // superset of the signal names supported on BSD, and
|
6 | // the unknown signals just fail to register, so we can
|
7 | // catch that easily enough.
|
8 | //
|
9 | // Don't bother with SIGKILL. It's uncatchable, which
|
10 | // means that we can't fire any callbacks anyway.
|
11 | //
|
12 | // If a user does happen to register a handler on a non-
|
13 | // fatal signal like SIGWINCH or something, and then
|
14 | // exit, it'll end up firing `process.emit('exit')`, so
|
15 | // the handler will be fired anyway.
|
16 |
|
17 | module.exports = [
|
18 | 'SIGABRT',
|
19 | 'SIGALRM',
|
20 | 'SIGBUS',
|
21 | 'SIGFPE',
|
22 | 'SIGHUP',
|
23 | 'SIGILL',
|
24 | 'SIGINT',
|
25 | 'SIGIOT',
|
26 | 'SIGPIPE',
|
27 | 'SIGPROF',
|
28 | 'SIGQUIT',
|
29 | 'SIGSEGV',
|
30 | 'SIGSYS',
|
31 | 'SIGTERM',
|
32 | 'SIGTRAP',
|
33 | 'SIGUSR2',
|
34 | 'SIGVTALRM',
|
35 | 'SIGXCPU',
|
36 | 'SIGXFSZ'
|
37 | ]
|
38 |
|
39 | if (process.platform === 'linux') {
|
40 | module.exports.push(
|
41 | 'SIGIO',
|
42 | 'SIGPOLL',
|
43 | 'SIGPWR',
|
44 | 'SIGSTKFLT',
|
45 | 'SIGUNUSED'
|
46 | )
|
47 | }
|