Advanced Programming in the UNIX® Environment
ptg10805159 Section 10.5 Interrupted System Calls 327 action to occur,which for this signal terminates the process. This is one ...
ptg10805159 328 Signals Chapter 10 To support this feature, the system calls aredivided into two categories: the ‘‘slow’’ system ...
ptg10805159 Section 10.5 Interrupted System Calls 329 To prevent applications from having to handle interrupted system calls, 4. ...
ptg10805159 330 Signals Chapter 10 Be awarethat UNIX systems from other vendors can have values different from those shown in th ...
ptg10805159 Section 10.6 Reentrant Functions 331 abort faccessat linkat select socketpair accept fchmod listen sem_post stat acc ...
ptg10805159 332 Signals Chapter 10 #include "apue.h" #include <pwd.h> static void my_alarm(int signo) { struct passwd *roo ...
ptg10805159 Section 10.7 SIGCLDSemantics 333 The semantics of the BSDSIGCHLDsignal arenormal, in the sense that its semantics ar ...
ptg10805159 334 Signals Chapter 10 #include "apue.h" #include <sys/wait.h> static void sig_cld(int); int main() { pid_t pi ...
ptg10805159 Section 10.8 Reliable-Signal Terminology and Semantics 335 The problem with this program is that the call tosignalat ...
ptg10805159 336 Signals Chapter 10 What happens if a blocked signal is generated morethan once beforethe process unblocks the si ...
ptg10805159 Section 10.9 killandraiseFunctions 337 #include <signal.h> int kill(pid_tpid,intsigno); int raise(intsigno); B ...
ptg10805159 338 Signals Chapter 10 Also understand that the test for process existence is not atomic. By the time that killretur ...
ptg10805159 Section 10.10 alarmandpauseFunctions 339 The only timepausereturns is if a signal handler is executed and that handl ...
ptg10805159 340 Signals Chapter 10 Earlier implementations ofsleeplooked like our program, with problems 1 and 2 corrected as de ...
ptg10805159 Section 10.10 alarmandpauseFunctions 341 #include "apue.h" unsigned int sleep2(unsigned int); static void sig_int(in ...
ptg10805159 342 Signals Chapter 10 Example Acommon use foralarm,inaddition to implementing thesleepfunction, is to put an upper ...
ptg10805159 Section 10.10 alarmandpauseFunctions 343 Here, we specifically want a slow system call to be interrupted. We’ll see ...
ptg10805159 344 Signals Chapter 10 10.11 Signal Sets We need a data type to represent multiple signals—asignal set.We’ll use thi ...
ptg10805159 Section 10.11Signal Sets 345 Using this implementation,sigaddsetturns on a single bit andsigdelsetturns offasingle b ...
ptg10805159 346 Signals Chapter 10 10.12 sigprocmaskFunction Recall from Section 10.8 that the signal mask of a process is the s ...
«
14
15
16
17
18
19
20
21
22
23
»
Free download pdf