hi cs161-ers:
this came up in my section and confused a few of us, so i thought that i
should just offer a clarification.
follow the fork() guidelines given in the cs161 man pages. these specify that
after a fork() the process file table are not shared, but file objects in the
parent process are. so, calls to lseek() by the child on a file descriptor
than was open in the parent will change the parents file descriptor as well.
if you feel like this causes races, it does. more advanced versions of unix
provide private read/write/lseek functions as well as options to fork to
disable some of the behavior described above.
hopefully this helps, good luck with asst2.
-gwa-
Show replies by date