POSIX Signals for Embedded and Real-Time Developers 2016-01-13T13:49:30-07:00

signals00aSignals are integral to any UNIX® or Linux® application and are part of the POSIX®.1 standard.

A signal is automatically sent to the parent when a child process terminates (SIGCHLD). Signals are also used for many other synchronous and asynchronous notifications, such as: waking a process when a wait call such as pause(), alarm(), or sleep() is performed (SIGALRM); or informing a process that it has issued a memory violation (SIGSEGV).

Signals in POSIX are quite powerful. Each thread can block incoming signals on a per-signal basis, define signal handlers for each signal it might receive, and queue signals (in the case of a real-time signal). Standard Unix POSIX signals do not guarantee delivery. Furthermore, POSIX signals are not queueable nor can they carry any information beyond the signal number itself.

POSIX.1b, supported fully by the LynxOS RTOS, improves this situation. POSIX.1b specifies real-time signals (a minimum of 8 are required) SIGRTMIN through SIGRTMAX to provide these capabilities. Real-time signals can carry data, are queued (delivery to a specific thread is guaranteed), and can be prioritized.

POSIX.1 Signals
SIGABRT Abnormal termination signal caused by the abort() function. A portable program should void catching SIGABRT.
SIGALRM The timer set by the alarm() function has timed-out.
SIGFPE Arithmetic exception, such as overflow or division by zero.
SIGHUP Hangup detected on controlling terminal or death of a controlling process.
SIGILL Illegal instruction indicating a program error. Applications may wish to catch this signal and attempt to recover from bugs. A portable program should not intentionally generate illegal instructions. After a SIGILL is caught, the only portable thing to do is to siglongjmp() back to a known place in your program (or callexit()).
SIGINT Interrupt special character typed on controlling keyboard.
SIGKILL Termination signal. This signal cannot be caught or ignored.
SIGPIPE Write to a pipe with no readers.
SIGQUIT Quit special character typed on controlling keyboard.
SIGSEGV Invalid memory reference. Like SIGILL, portable programs should not intentionally generate invalid memory references.
SIGTERM Termination signal.
SIGUSR1 Application-defined signal 1.
SIGUSR2 Application-defined signal 2.
Job Control Signals (POSIX.1)
SIGCHLD Child process terminated or stopped. By default, this signal is ignored.
SIGCONT Continue the process if it is currently stopped; otherwise, ignore the signal.
SIGSTOP Stop signal. This signal cannot be caught or ignored.
SIGTSTP Stop special character typed on the controlling keyboard.
SIGTTIN Read from the controlling terminal attempted by a member of a background process group.
SIGTTOU Write to controlling terminal attempted by a member of a background process group


[do_widget widget_classes=none id=text-14 wrap=div title=h2]