View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000447 | 1003.1(2008)/Issue 7 | System Interfaces | public | 2011-05-19 19:48 | 2013-04-16 13:06 |
Reporter | eblake | Assigned To | ajosey | ||
Priority | normal | Severity | Objection | Type | Enhancement Request |
Status | Closed | Resolution | Accepted As Marked | ||
Name | Eric Blake | ||||
Organization | Red Hat | ||||
User Reference | ebb.strerror_r | ||||
Section | strerror | ||||
Page Number | 1999 | ||||
Line Number | 63245 | ||||
Interp Status | Approved | ||||
Final Accepted Text | See 0000447:0000808 | ||||
Summary | 0000447: strerror_r and strerror_l error checking | ||||
Description | The 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 Action | 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. 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. | ||||
Tags | tc1-2008 |
|
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. |
|
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. |
|
Interpretation proposed 16 June 2011 for final 30 day review |
|
The interpretation is now approved. |
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 |