View Issue Details

IDProjectCategoryView StatusLast Update
00001531003.1(2008)/Issue 7System Interfacespublic2013-04-16 13:06
Reportergeoffclare Assigned Toajosey  
PrioritynormalSeverityObjectionTypeOmission
Status ClosedResolutionAccepted 
NameGeoff Clare
OrganizationThe Open Group
User Reference
Sectionwaitid
Page Number2190
Line Number69084
Interp StatusApproved
Final Accepted Text0000153:0000291
Summary0000153: waitid() return of 0 is ambiguous
DescriptionThe description of waitid() states:

    "If waitid() returns because a child process was found that
    satisfied the conditions indicated by the arguments idtype and
    options, then the structure pointed to by infop shall be filled in
    by the system with the status of the process. The si_signo member
    shall always be equal to SIGCHLD."

However, it does not state what happens to the structure pointed to
by infop when waitid() returns because WNOHANG was specified and
status is not available for any process specified by idtype and id.

Since the return value is zero in both cases, applications need to
examine at least one field of the structure in order to distinguish
between the cases.

Readers might assume that since the standard only says the structure is
filled in for one case, it is left unchanged for the other. However,
existing practice seems to be to zero out the structure (or, at least
the fields I examined - si_signo, si_pid, si_code and si_status).

Since zero is a special value for signal numbers and process IDs, I
propose that the standard should require the si_signo and si_pid fields
to be set to zero.

The word "always" in the last sentence of the above quote is also
a problem: from the context, the intention appears to be that this
statement only applies when waitid() fills in the structure with the
status of a child process, but it could be taken to mean si_signo is
set to SIGCHLD for the no-status-available case as well.
Desired ActionChange

    "... with the status of the process. The si_signo member shall
    always be equal to SIGCHLD."

to

    "... with the status of the process; the si_signo member shall be
    set equal to SIGCHLD. If waitid() returns because WNOHANG was
    specified and status is not available for any process specified by
    idtype and id, then the si_signo and si_pid members of the
    structure pointed to by infop shall be set to zero and the values
    of other members of the structure are unspecified."
Tagstc1-2008

Activities

msbrown

2009-09-24 15:52

manager   bugnote:0000239

 "The standard is unclear on this issue, and no conformance distinction can be made between alternative implementations based on this. This is being referred to the sponsor."

ajosey

2009-11-07 07:30

manager   bugnote:0000291

Interpretation response
------------------------

The standard is unclear on this issue, and no conformance
distinction can be made between alternative implementations based
on this. This is being referred to the sponsor.


Rationale:
-------------
None.

Notes to the Editor (not part of this interpretation):
-------------------------------------------------------

Make the change suggested by the submitter

Issue History

Date Modified Username Field Change
2009-09-22 09:29 geoffclare New Issue
2009-09-22 09:29 geoffclare Status New => Under Review
2009-09-22 09:29 geoffclare Assigned To => ajosey
2009-09-22 09:29 geoffclare Name => Geoff Clare
2009-09-22 09:29 geoffclare Organization => The Open Group
2009-09-22 09:29 geoffclare Section => waitid
2009-09-22 09:29 geoffclare Page Number => 2190
2009-09-22 09:29 geoffclare Line Number => 69084
2009-09-22 09:29 geoffclare Interp Status => ---
2009-09-24 15:52 msbrown Interp Status --- => Pending
2009-09-24 15:52 msbrown Note Added: 0000239
2009-09-24 15:52 msbrown Status Under Review => Interpretation Required
2009-09-24 15:53 msbrown Resolution Open => Accepted
2009-11-07 07:30 ajosey Note Added: 0000291
2009-11-07 07:30 ajosey Interp Status Pending => Proposed
2009-11-07 07:30 ajosey Final Accepted Text => 0000153:0000291
2009-12-07 16:56 ajosey Interp Status Proposed => Approved
2010-09-21 11:18 geoffclare Tag Attached: tc1-2008
2013-04-16 13:06 ajosey Status Interpretation Required => Closed