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 #60
Topic: waitid() , flags usage Relevant Sections: XSH waitid() Page: 1615 Line: 50182,50190

1. In the 2nd sentence of DESCRIPTION it states: "It records the current state of a child in the structure pointed to by infop." This text is vague -- it does not explain what fields should be filled in by waitid().

2. The text states the following about the flags used for the options parameter of waitid(): "The options argument is used to specify which state changes waitid() shall wait for. It is formed by OR ing together one or more of the following flags:

WEXITED Wait for processes that have exited.

WSTOPPED Status shall be returned for any child that has stopped upon receipt of a signal.

WCONTINUED Status shall be returned for any child that was stopped and has been continued.

WNOHANG Return immediately if there are no children to wait for.

WNOWAIT Keep the process whose status is returned in infop in a waitable state. This shall not affect the state of the process; the process may be waited for again after this call completes."

The problem is the introducing sentence. The current wording would allow calls like

waitid(..., ..., ..., WNOHANG)
waitid(..., ..., ..., WNOWAIT)

Both calls make no sense since it is not specified what has to be waited on. Instead it should be required that at least on of the first three flags must be set since those three specify what the function is supposed to do.

1. After the quoted sentence, add the following: "The fields of the structure pointed to by infop are filled in are filled in as described for the SIGCHLD signal in the XBD signal.h page." Add signal.h to the SEE ALSO line.

2. Replace line 50190f with The options argument is used to specify which state changes waitid() shall wait for. It is formed by OR ing together the following flags.

Add after line 50199 (or alternatively after line 50195): At least one of the flags WEXITED, WSTOPPED, or WCONTINUED must be set in /options/.

Interpretation Response #60
The standards states the requirements for flags usage, and conforming implementations must conform to this. However, concerns have been raised about this which are being referred to the sponsor.

Rationale for Interpretation
The working group considered issue 1 to be editorial but agreed to recommend to add wording to clarify in a future revision.