Introduction - If you have any usage issues, please Google them yourself
The sleep function of the complete implementation of an experimental requirements: one, use the alarm function to achieve timing. 2 we must correctly handle the relationship between in the mysleep function alarm clock with caller may set the alarm clock. For example, how to solve different signal processing functions to save and restore? How to deal with the caller to set the alarm clock mysleep function of the alarm clock early as loud? How to deal with the calling process to shield the SIGALRM signal? 3, are not allowed in any race condition (time window). In short, the mysleep the implementation details should be transparent to the caller, that is, regardless of when the the realization mysleep function whether to use the alarm function, the caller whether and how to use the alarm function should not have any impact.