Information Technology Reference
In-Depth Information
notification is sent by calling signal . Signals are used for terminating an appli-
cation, suspending it temporarily for debugging, resuming after a suspension,
timer expiration, and a host of other reasons. In the default case, where the
receiving application did not specify a signal handler, the kernel implements a
standard one on its behalf.
Exercises
1. Can UNIX fork return an error? Why or why not?
Note: You can answer this question by looking at the manual page for
fork, but before you do that, think about what the fork system call does.
If you were designing this call, would you need to allow fork to return an
error?
Note: A manual page (or \man page") is a standard way of documenting
Unix system calls and utility programs. On a Unix machine, you can access
a manual page by running the man command (e.g., manfork ). Another
way to find manual pages is via web search (e.g., search for manfork and
many of the top results will be manual pages for the fork system call.)
2. Can UNIX exec return an error? Why or why not?
Note: You can answer this question by looking at the manual page for
exec, but before you do that, think about what the exec system call does.
If you were designing this call, would you need to allow it to return an
error?
3. What happens if we run the following program on UNIX?
main(){
while(fork()>=0)
;
}
4. Explain what must happen for UNIX wait to return (successfully and)
immediately.
3.2
Input/output
Computer systems have a wide diversity of input and output devices: keyboard,
mouse, disk, USB port, Ethernet, WiFi, display, hardware timer, microphone,
camera, accelerometer, and GPS, to name a few.
To deal with this diversity, we could specialize the application programming
interface for each device, customizing it to the device's specic characteristics.
Search WWH ::




Custom Search