Advanced Programming in the UNIX® Environment
ptg10805159 Section 14.4 I/O Multiplexing 507 Withpoll,instead of building a set of descriptors for each condition (readability, ...
ptg10805159 508 Advanced I/O Chapter 14 The first four rows of Figure14.17 test for readability,the next three test for writabil ...
ptg10805159 Section 14.5 Asynchronous I/O 509 None of the implementations described in this book restartpollorselectwhen a signa ...
ptg10805159 510 Advanced I/O Chapter 14 14.5.1 SystemVAsynchronous I/O System V provides a limited form of asynchronous I/O that ...
ptg10805159 Section 14.5 Asynchronous I/O 511 Enable asynchronous I/O on the descriptor by callingfcntlwith a command ofF_SETFL ...
ptg10805159 512 Advanced I/O Chapter 14 discuss shortly.Theaio_sigeventfield controls how the application is notified about the ...
ptg10805159 Section 14.5 Asynchronous I/O 513 #include <aio.h> int aio_fsync(intop,struct aiocb *aiocb); Returns: 0 if OK, ...
ptg10805159 514 Advanced I/O Chapter 14 We use asynchronous I/O when we have other processing to do and we don’t want to block w ...
ptg10805159 Section 14.5 Asynchronous I/O 515 If an asynchronous I/O operation is successfully canceled, calling theaio_error fu ...
ptg10805159 516 Advanced I/O Chapter 14 We can determine the value ofAIO_LISTIO_MAXby calling thesysconffunction with thenamearg ...
ptg10805159 Section 14.5 Asynchronous I/O 517 if (argc != 3) err_quit("usage: rot13 infile outfile"); if ((ifd = open(argv[1], O ...
ptg10805159 518 Advanced I/O Chapter 14 unsigned char translate(unsigned char c) { /* same as before */ } int main(int argc, cha ...
ptg10805159 Section 14.5 Asynchronous I/O 519 numop++; } break; case READ_PENDING: if ((err = aio_error(&bufs[i].aiocb)) == ...
ptg10805159 520 Advanced I/O Chapter 14 numop--; break; } } if (numop == 0) { if (off >= sbuf.st_size) break; }else { if (aio ...
ptg10805159 Section 14.6 readvandwritevFunctions 521 14.6 readvandwritev Functions The readv and writev functions let us read in ...
ptg10805159 522 Advanced I/O Chapter 14 Example In Section 20.8, in the function _db_writeidx, we need to write two buffers cons ...
ptg10805159 Section 14.7 readnandwritenFunctions 523 In summary,weshould always try to use the fewest number of system calls nec ...
ptg10805159 524 Advanced I/O Chapter 14 of file while reading, we return the number of bytes copied to the caller’s buffer if we ...
ptg10805159 Section 14.8 Memory-Mapped I/O 525 14.8 Memory-Mapped I/O Memory-mapped I/O lets us map a file on disk into a buffer ...
ptg10805159 526 Advanced I/O Chapter 14 stack memory-mapped portion of file heap uninitialized data (bss) initialized data text ...
«
23
24
25
26
27
28
29
30
31
32
»
Free download pdf