The restart library is a collection of functions that restart themselves when they have not completed because of a possibly temporary event. We use functions from the restart library throughout the book to simplify programs that must deal with the effects of signals and incomplete I/O. The source code for the restart library is available on the book web site. We have included only those functions that are needed in the book. You can easily add other functions, if necessary.
The restart library addresses two main types of events: interruption by a signal and incomplete I/O. For example, many library functions, including
write, return –1 and set
EINTR when interrupted by a signal before any I/O takes ...