The Linux Programming Interface
Signals: Advanced Features 457 z When sending a realtime signal, it is possible to specify data (an integer or pointer value) th ...
458 Chapter 22 On Linux, this call returns –1. The reason for this is that Linux employs a different model for limiting the numb ...
Signals: Advanced Features 459 Listing 22-2: Using sigqueue() to send realtime signals ––––––––––––––––––––––––––––––––––––––––– ...
460 Chapter 22 A call to sigqueue() may fail if the limit on the number of queued signals has been reached. In this case, errno ...
Signals: Advanced Features 461 If the first argument is supplied, the main program blocks all signals, and then sleeps for the n ...
462 Chapter 22 We continue by using the shell kill command to send a signal to the catch_rtsigs pro- gram. As before, we see tha ...
Signals: Advanced Features 463 int main(int argc, char *argv[]) { struct sigaction sa; int sig; sigset_t prevMask, blockMask; if ...
464 Chapter 22 22.9 Waiting for a Signal Using a Mask: sigsuspend().......................................................... Be ...
Signals: Advanced Features 465 and the main program resumes, the pause() call will block until a second instance of SIGINT is de ...
466 Chapter 22 z Loop until gotSigquit is set r. Each loop iteration performs the following steps: Display the current value of ...
Signals: Advanced Features 467 e if (sigaction(SIGINT, &sa, NULL) == -1) errExit("sigaction"); if (sigaction(SIGQUIT, &s ...
468 Chapter 22 The main program continues its loop: === LOOP 2 Starting critical section, signal mask is: 2 (Interrupt) 3 (Quit) ...
Signals: Advanced Features 469 An example of the use of sigwaitinfo() is shown in Listing 22-6. This program first blocks all si ...
470 Chapter 22 In the output for the accepted SIGUSR1 signal, we see that the si_value field has the value 100. This is the valu ...
Signals: Advanced Features 471 printf(" si_pid=%ld, si_uid=%ld\n", (long) si.si_pid, (long) si.si_uid); } } –––––––––––––––––––– ...
472 Chapter 22 The mask argument is a signal set that specifies the signals that we want to be able to read via the signalfd fil ...
Signals: Advanced Features 473 operation (Section 5.3) to set the O_NONBLOCK flag for the file descriptor, so that reads are non ...
474 Chapter 22 A signalfd file descriptor can be monitored along with other descriptors using select(), poll(), and epoll (descr ...
Signals: Advanced Features 475 22.13 Earlier Signal APIs (System V and BSD) Our discussion of signals has focused on the POSIX s ...
476 Chapter 22 disposition to ignore. The sigpause() function is similar to sigsuspend(), but removes just one signal from the p ...
«
21
22
23
24
25
26
27
28
29
30
»
Free download pdf