Geofram
Geofram

Reputation: 35

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

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.

Upvotes: 3

Views: 5306

Answers (2)

jim mcnamara
jim mcnamara

Reputation: 16389

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.

Upvotes: 2

Joachim Isaksson
Joachim Isaksson

Reputation: 180987

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

Upvotes: 5

Related Questions