Interpretations

Answering questions that may arise related to the meaning of portions of an IEEE standard concerning specific applications.

IEEE Standards Interpretation for IEEE Std 1003.1™-2001 IEEE Standard Standard for Information Technology -- Portable Operating System Interface (POSIX®)

Copyright © 2006 by the Institute of Electrical and Electronics Engineers, Inc. 3 Park Avenue New York, New York 10016-5997 USA All Rights Reserved.

Interpretations are issued to explain and clarify the intent of a standard and do not constitute an alteration to the original standard. In addition, interpretations are not intended to supply consulting information. Permission is hereby granted to download and print one copy of this document. Individuals seeking permission to reproduce and/or distribute this document in its entirety or portions of this document must contact the IEEE Standards Department for the appropriate license. Use of the information contained in this document is at your own risk.

IEEE Standards Department Copyrights and Permissions 445 Hoes Lane, Piscataway, New Jersey 08855-1331, USA

Interpretation Request #84
Topic: sigaction SA_RESTART Relevant Sections: XSH sigaction

The restart behavior of interruptible functions which use a timeout (such as nanosleep and pselect) is not described in sufficient detail when SA_RESTART is in effect. The duration of the timeout following the restart varies greatly among implementations.

For example, if a 600ms nanosleep call is interrupted by a signal after 200ms, and SA_RESTART was used, the observed possibilities on restart are:

1) Do not restart the function, return EINTR immediately.
2) Restart the timeout using the remaining time interval (400ms).
3) Restart the timeout using the original full time interval (600ms).

Action:

Applications should not depend on any particular behavior in this situation.

To make this clear, insert a new sentence before the sentence which starts with "If the flag is not set...":

If an interruptible function which uses a timeout is restarted, the the behavior and duration of the timeout following the restart is undefined.

Interpretation Response
The standard does not speak to this issue, and as such no conformance distinction can be made between alternative implementations based on this. This is being referred to the sponsor.

Rationale for Interpretation
None.