Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WSTOPSIG(status) == 22 & WTERMSIG(status) == 9; Where do these numbers come from?

Tags:

c

fork

waitpid

I'm looking over an implementation of esh (easy shell) and cannot understand what signals are 22 and 9 in this case. Ideally there is a more descriptive constant, but I cannot find a list.

like image 791
Geofram Avatar asked Dec 03 '25 02:12

Geofram


2 Answers

The list of signals and their numbers including the two you're seeing is actually specified by POSIX.1-1990, and can for example be found if you scroll down a little in this manual page.

SIGKILL       9       Term    Kill signal
SIGTTOU   22,22,27    Stop    tty output for background process
like image 189
Joachim Isaksson Avatar answered Dec 04 '25 17:12

Joachim Isaksson


SIGTTOU 22,22,27    Stop    tty output for background process
SIGKILL  9         Term Kill signal

Those are signal numbers. The meanings are platform dependant - these are the Linux ones.

See:

http://linux.about.com/od/commands/l/blcmdl7_signal.htm

A signal is sent to a process via the kernel. In this case SIGTTOU says a background process tried to write to the tty. This causes a kernel issue, which raises that signal. By default the result of that signal is to terminate the process.

like image 25
jim mcnamara Avatar answered Dec 04 '25 17:12

jim mcnamara



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!