Download





Exercises

14.1

What happens in Figure when we reset the signal handler, and the process has not established a handler for SIGALRM?

14.2

In Figure, we print a warning if the process already has an alarm timer set. Modify the function to reset this alarm for the process after the connect, before the function returns.

14.3

Modify Figure as follows: Before calling read, call recv specifying MSG_PEEK. When this returns, call ioctl with a command of FIONREAD and print the number of bytes queued on the socket's receive buffer. Then, call read to actually read the data.

14.4

What happens to the data in a standard I/O buffer that has not yet been output if the process falls off the end of the main function instead of calling exit?

14.5

Apply each of the two changes described following Figure and verify that each one corrects the buffering problem.



     Python   SQL   Java   php   Perl 
     game development   web development   internet   *nix   graphics   hardware 
     telecommunications   C++ 
     Flash   Active Directory   Windows