alarm

The section 8.7.1 demonstrates how a time-out is implemented for a critical piece of code using the alarm() function.