View Issue Details

IDProjectCategoryView StatusLast Update
00004471003.1(2008)/Issue 7System Interfacespublic2013-04-16 13:06
Reportereblake Assigned Toajosey  
PrioritynormalSeverityObjectionTypeEnhancement Request
Status ClosedResolutionAccepted As Marked 
NameEric Blake
OrganizationRed Hat
User Referenceebb.strerror_r
Sectionstrerror
Page Number1999
Line Number63245
Interp StatusApproved
Final Accepted TextSee 0000447:0000808
Summary0000447: strerror_r and strerror_l error checking
DescriptionThe standard is clear that checking for errors from strerror( ) requires
priming errno to 0, but sterror_l( ) needs the same treatment, since it
is required to return a string in the optional EINVAL case for an
out-of-range errnum, and NULL is only reserved for other failures like
EINVAL for a bad locale object. Meanwhile, since strerror( ) must not
modify errno on success, it makes sense to require the same for
strerror_r( ).
Desired ActionAt line 63244 [XSH strerror DESCRIPTION], change:

The strerror( ) and strerror_l( ) functions shall not change the setting of
errno if successful.

Since no return value is reserved to indicate an error, an application
wishing to check for error situations should set errno to 0, then call
strerror( ), then check errno.

to:

The strerror( ) and strerror_l( ) functions shall not change the setting of
errno if successful. The strerror_r( ) function shall not change the
setting of errno.

Since no return value is reserved to indicate an error of strerror( ), an
application wishing to check for error situations should set errno to 0,
then call strerror( ), then check errno. Similarly, since strerror_l( )
is required to return a string for some errors, an application wishing to
check for all error situations should set errno to 0, then call
strerror_l( ), then check errno.
Tagstc1-2008

Relationships

related to 0000384 Closedajosey the stdarg macros should not modify errno 

Activities

nick

2011-06-09 15:55

manager   bugnote:0000808

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:
-------------
See description.

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

At line 63244 [XSH strerror DESCRIPTION], change:

The strerror( ) and strerror_l( ) functions shall not change the setting of
errno if successful.

Since no return value is reserved to indicate an error, an application
wishing to check for error situations should set errno to 0, then call
strerror( ), then check errno.

to:

The strerror( ) and strerror_l( ) functions shall not change the setting of
errno if successful.

Since no return value is reserved to indicate an error of strerror( ), an
application wishing to check for error situations should set errno to 0,
then call strerror( ), then check errno. Similarly, since strerror_l( )
is required to return a string for some errors, an application wishing to
check for all error situations should set errno to 0, then call
strerror_l( ), then check errno.

nick

2011-06-09 15:57

manager   bugnote:0000809

The interpretation response above does not include the changes strerror_r suggested by the submitter. The change proposed here is suitable for TC1, but strerror_r should wait for the next revision. A separate bug should be filed if that is desired.

ajosey

2011-06-16 10:18

manager   bugnote:0000852

Interpretation proposed 16 June 2011 for final 30 day review

ajosey

2011-07-29 06:12

manager   bugnote:0000900

The interpretation is now approved.

Issue History

Date Modified Username Field Change
2011-05-19 19:48 eblake New Issue
2011-05-19 19:48 eblake Status New => Under Review
2011-05-19 19:48 eblake Assigned To => ajosey
2011-05-19 19:48 eblake Name => Eric Blake
2011-05-19 19:48 eblake Organization => Red Hat
2011-05-19 19:48 eblake User Reference => ebb.strerror_r
2011-05-19 19:48 eblake Section => strerror
2011-05-19 19:48 eblake Page Number => 1999
2011-05-19 19:48 eblake Line Number => 63245
2011-05-19 19:48 eblake Interp Status => ---
2011-06-09 15:55 nick Note Added: 0000808
2011-06-09 15:55 nick Interp Status --- => Pending
2011-06-09 15:55 nick Final Accepted Text => See 0000447:0000808
2011-06-09 15:55 nick Status Under Review => Interpretation Required
2011-06-09 15:55 nick Resolution Open => Accepted As Marked
2011-06-09 15:56 nick Tag Attached: tc1-2008
2011-06-09 15:57 nick Note Added: 0000809
2011-06-16 10:18 ajosey Interp Status Pending => Proposed
2011-06-16 10:18 ajosey Note Added: 0000852
2011-07-29 06:12 ajosey Interp Status Proposed => Approved
2011-07-29 06:12 ajosey Note Added: 0000900
2013-04-16 13:06 ajosey Status Interpretation Required => Closed
2016-07-28 15:07 eblake Relationship added related to 0000384