Unformatted text preview: tion is included as a convenience for application errors. It simply prints its input and then terminates. Figure A.1 shows the code for the error reporting functions. A.3 Error-handling wrappers Here are some examples of the different error-handling wrappers. Unix-style error-handling wrappers
Figure A.2 shows the wrapper for the Unix-style wait function. If the wait returns with an error, the wrapper prints an informative message and then exits. Otherwise, it returns a PID to the caller. Figure A.3 shows the wrapper for the Unix-style kill function. Notice that this function, unlike Wait, returns void on success. Posix-style error-handling wrappers
Figure A.4 shows the wrapper for the Posix-style pthread mutex lock function. Like most Posixstyle functions, it does not overload useful results with error return codes, so the wrapper returns void on success. One exception is the Posix-style pthread cond timedwait which returns an error code of ETIMEDOUT if the call times out. Since this particular re...
View Full Document