The Linux Programming Interface
Signals: Fundamental Concepts 397 z SIGIO is ignored by default on several UNIX implementations (particularly BSD derivatives). ...
398 Chapter 20 temporarily establish a handler for a signal, and then reset the disposition of the signal to whatever it was pre ...
Signals: Fundamental Concepts 399 Invocation of a signal handler may interrupt the main program flow at any time; the kernel cal ...
400 Chapter 20 Listing 20-1 (on page 399) shows a simple example of a signal handler function and a main program that establishe ...
Signals: Fundamental Concepts 401 various example programs, we’ll nevertheless call printf() from a signal handler as a simple m ...
402 Chapter 20 The pid argument identifies one or more processes to which the signal specified by sig is to be sent. Four differ ...
Signals: Fundamental Concepts 403 z The SIGCONT signal is treated specially. An unprivileged process may send this signal to any ...
404 Chapter 20 z IPC channels such as pipes and FIFOs: We set up the monitored process so that it holds a file descriptor open f ...
Signals: Fundamental Concepts 405 Listing 20-3: Using the kill() system call ––––––––––––––––––––––––––––––––––––––––––––––––––– ...
406 Chapter 20 20.8 Displaying Signal Descriptions Each signal has an associated printable description. These descriptions are l ...
Signals: Fundamental Concepts 407 Multiple signals are represented using a data structure called a signal set, pro- vided by the ...
408 Chapter 20 The GNU C library implements three nonstandard functions that perform tasks that are complementary to the standar ...
Signals: Fundamental Concepts 409 functions are also not async-signal-safe (i.e., beware of indiscriminately calling them from s ...
410 Chapter 20 20.10 The Signal Mask (Blocking Signal Delivery) For each process, the kernel maintains a signal mask—a set of si ...
Signals: Fundamental Concepts 411 To temporarily prevent delivery of a signal, we can use the series of calls shown in Listing 2 ...
412 Chapter 20 The sigpending() system call returns the set of signals that are pending for the call- ing process in the sigset_ ...
Signals: Fundamental Concepts 413 pid = getLong(argv[1], 0, "PID"); numSigs = getInt(argv[2], GN_GT_0, "num-sigs"); sig = getInt ...
414 Chapter 20 $ ./sig_sender 5368 1000000 10 2 Send SIGUSR1 signals, plus a SIGINT ./sig_sender: sending signal 10 to process 5 ...
Signals: Fundamental Concepts 415 if (sig == SIGINT) gotSigint = 1; else sigCnt[sig]++; } int main(int argc, char *argv[]) { int ...
416 Chapter 20 20.13 Changing Signal Dispositions: sigaction().................................................................. ...
«
18
19
20
21
22
23
24
25
26
27
»
Free download pdf