The Linux Programming Interface
Alternative I/O Models 1337 63.2.2 The poll() System Call The poll() system call performs a similar task to select(). The major ...
1338 Chapter 63 It is permissible to specify events as 0 if we are not interested in events on a particular file descriptor. Fur ...
Alternative I/O Models 1339 z POLLRDHUP is a Linux-specific flag available since kernel 2.6.17. In order to obtain this definiti ...
1340 Chapter 63 The following shell session shows an example of what we see when running this program. The command-line argument ...
Alternative I/O Models 1341 srandom((int) time(NULL)); for (j = 0; j < numWrites; j++) { randPipe = random() % numPipes; prin ...
1342 Chapter 63 Regular files File descriptors that refer to regular files are always marked as readable and writ- able by selec ...
Alternative I/O Models 1343 On some other UNIX implementations, if the read end of a pipe is closed, then, instead of returning ...
1344 Chapter 63 of the connection. The use of this flag allows an application that uses the epoll edge- triggered interface to e ...
Alternative I/O Models 1345 z The timeout precision afforded by select() (microseconds) is greater than that afforded by poll() ...
1346 Chapter 63 63.2.5 Problems with select() and poll() The select() and poll() system calls are the portable, long-standing, a ...
Alternative I/O Models 1347 the signal is delivered to the process. To use signal-driven I/O, a program per- forms the following ...
1348 Chapter 63 Example program Listing 63-3 provides a simple example of the use of signal-driven I/O. This program performs th ...
Alternative I/O Models 1349 / Establish handler for "I/O possible" signal / sigemptyset(&sa.sa_mask); sa.sa_flags = SA_RESTA ...
1350 Chapter 63 Establish the signal handler before enabling signal-driven I/O Because the default action of SIGIO is to termina ...
Alternative I/O Models 1351 system call returns in the range –1 to –4095 as indicating an error, copies this (abso- lute) value ...
1352 Chapter 63 Signal-driven I/O works for stream sockets in both the UNIX and the Internet domains. A signal is generated in t ...
Alternative I/O Models 1353 (In order to obtain the definitions of the F_SETSIG and F_GETSIG constants from , we must define the ...
1354 Chapter 63 sigtimedwait() (Section 22.10). These system calls return a siginfo_t structure that con- tains the same informa ...
Alternative I/O Models 1355 F_OWNER_TID The pid field specifies the ID of a thread that is to be the target of “I/O pos- sible” ...
1356 Chapter 63 z The epoll_ctl() system call manipulates the interest list associated with an epoll instance. Using epoll_ctl() ...
«
65
66
67
68
69
70
71
72
73
74
»
Free download pdf