Advanced Programming in the UNIX® Environment

(lily) #1
ptg10805159

320 Signals Chapter 10


SIGPROF This signal is marked obsolescent in SUSv4, so it might be removed in a
futureversion of the standard. This signal is generated when a profiling
interval timer set by thesetitimer( 2 )function expires.
SIGPWR This signal is system dependent. Its main use is on a system that has an
uninterruptible power supply(UPS).Ifpower fails, the UPS takes over
and the softwarecan usually be notified. Nothing needs to be done at
this point, as the system continues running on battery power.But if the
battery gets low (for example, if the power is offfor an extended period),
the software is usually notified again; at this point, it behooves the
system to shut everything down. This is whenSIGPWRshould be sent.
On most systems, the process that is notified of the low-battery condition
sends theSIGPWRsignal to theinitprocess, andinithandles the
system shutdown.

Solaris 10 and some Linux distributions have entries in theinittabfile for
this purpose:powerfailandpowerwait(orpowerokwait).
In Figure10.1, we labeled the default action forSIGPWRas either ‘‘terminate’’
or ‘‘ignore.’’Unfortunately,the default depends on the system. The default on
Linux is to terminate the process. On Solaris, the signal is ignored by default.

SIGQUIT This signal is generated by the terminal driver when we press the
terminal quit key (often Control-backslash). This signal is sent to all
processes in the foreground process group (refer to Figure9.9). This
signal not only terminates the foreground process group (as does
SIGINT), but also generates acorefile.

SIGSEGV This signal indicates that the process has made an invalid memory
reference (which is usually a sign that the program has a bug, such as
dereferencing an uninitialized pointer).

The name SEGV stands for ‘‘segmentation violation.’’

SIGSTKFLT This signal is defined only by Linux. It showed up in the earliest
versions of Linux, where it was intended to be used for stack faults taken
by the math coprocessor.This signal is not generated by the kernel, but
remains for backwardcompatibility.
SIGSTOP This job-control signal stops a process. It is similar to the interactive stop
signal (SIGTSTP), butSIGSTOPcannot be caught or ignored.

SIGSYS This signals an invalid system call. Somehow,the process executed a
machine instruction that the kernel thought was a system call, but the
parameter with the instruction that indicates the type of system call was
invalid. This might happen if you build a program that uses a new
system call and you then try to run the same binary on an older version
of the operating system wherethe system call doesn’t exist.
Free download pdf