This preview shows page 1. Sign up to view the full content.
Unformatted text preview: s to another via context switches. At the application level, a process can send a Unix signal to another process that abruptly transfers control to a signal handler in the recipient. An individual program can react to errors by sidestepping the usual stack discipline and making nonlocal jumps to arbitrary locations in other functions (similar to the exceptions supported by C++ and Java). This chapter describes these various forms of exceptional control, and shows you how to use them in your C programs. The techniques you will learn about — creating processes, reaping terminated processes, sending and receiving signals, making non-local jumps — are the foundation of important programs such as Unix shells (Problem 8.20) and Web servers (Chapter 12). 391 392 CHAPTER 8. EXCEPTIONAL CONTROL FLOW 8.1 Exceptions
Exceptions are a form of exceptional control ﬂow that are implemented partly by the hardware and partly by the operating system. Because they are partly implemented in hardware, the details vary from system to system. However, the basic ideas are the...
View Full Document
- Spring '10
- The American