Modify the program from Figure 24 to print the device number of /dev/tty beforeand after the child calls setsid(2). Try the program on FreeBSD 8.0 and one other platform. Explain the results
What will be an ideal response?
On Linux 3.2.0, Mac OS X 10.6.8, and Solaris 10, the device number is the same regardless of whether the child process has a controlling terminal. On FreeBSD 8.0, however,the device number changes when the process no longer has acontrolling terminal. This is because FreeBSD 8.0 treats the /dev/tty node almost like a symbolic link in the kernel. When it is accessed (even if it isn’t being opened), the v-node that is returned is the v-node for the real terminal device assigned as the controlling terminal. When a process doesn’t have a controlling terminal, the device number printed is the device number of the pseudo device implementing the/dev/ttyfunctionality
You might also like to view...
Mistaking a legitimate program for a virus is a ____________
a. Heuristic error b. False negative c. False positive d. None of the above
How many fingers are involved in a "pinch and pan" gesture?
A. one B. two C. three D. four