

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


CS241 System Programming Instructor Klara Nahrstedt Posted May 1, 2006
Solution: Clearly the wrong thing happens if a system call is executed remotely. Trying to read a file on the remote machine will not work if the file is not there. Also, setting an alarm on the remote machine will not send a signal back to the calling machine. One way to handle remote system calls is to trap them and send them back to the originating site for execution.
For (; ;) { Wait for a client request on the listening file descriptor Create a private two-way communication channel to the client Fork a child to handle the client Close file descriptor for the private communication channel Clean up zombie children }
Solution: Exercise 18.5 in R&R (page 616)
Solution: Exercise 18.10 in R&R (page 622)
if ((child = fork()) == -1) { perror(“failed to fork a child”); return 1; } if (child == 0) bytecopied = copyfile(STDIB_FILENO, communfd);
else bytecopied = copyfile(communfd, SDTOUT_FILENO);
What happens if we do this replacement?
Solution: Exercise 18.17 in R&R (page 627)
Solution: Exercise 20.4 in R&R (page 700)
Solution: Exercise 20.7 in R&R (page 701)