View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0000106 | 1003.1(2008)/Issue 7 | System Interfaces | public | 2009-06-30 19:16 | 2013-04-16 13:06 |
| Reporter | Assigned To | ajosey | |||
| Priority | normal | Severity | Objection | Type | Omission |
| Status | Closed | Resolution | Accepted As Marked | ||
| Name | Don Cragun | ||||
| Organization | Self | ||||
| User Reference | |||||
| Section | time() | ||||
| Page Number | 2107 | ||||
| Line Number | 66673 | ||||
| Interp Status | Approved | ||||
| Final Accepted Text | 0000106:0000197 | ||||
| Summary | 0000106: time() missing error | ||||
| Description | _____________________________________________________________________________ OBJECTION Enhancement Request Number 35 dcragun:xxxxxxxxx Defect in XSH time() (rdvk# 3) {time() missing error} Sat, 25 Apr 2009 06:36:18 +0100 (BST) _____________________________________________________________________________ Many systems today have 32-bit time_t types. At some point in the future, these systems will be unable to represent seconds since the Epoch (the return value from time()) in an object of type time_t, but the ERRORS section says "No errors are defined." As with other interfaces where returned information might not fit into the space reserved for the return value, time() should specify that when this happens, (time_t)-1 will be returned and errno will be set to EOVERFLOW. | ||||
| Desired Action | Send this issue down the interpretations track: the standard is silent on this issue; concerns have been forwarded to the sponsor. Change: "shall return the value of time." on P2107, L66670 in the RETURN VALUE section to: "shall return the value of time without changing the value of errno." Change: "No errors are defined." on P2107, L66673 in the ERRORS sections to: "The time() function shall fail if: [EOVERFLOW] The current value of time will not fit in an object of type time_t." Change: "None." on P2108, L66710 in the APPLICATION USAGE section to: "As (time_t)-1 is a permissible return value in a successful situation, an application wishing to check for error conditions should set errno to 0, then call time(), and, if it returns (time_t)-1, check to see if errno is non-zero." | ||||
| Tags | tc1-2008 | ||||
|
|
Add to clock_gettime Page 668 after line 22669 The clock_gettime() function shall fail if: [EOVERFLOW] The current value of time will not fit in an object of type time_t." On the time() page: Add a may fail case. Change: "No errors are defined." on P2107, L66673 in the ERRORS sections to: "The time() function may fail if: [EOVERFLOW] The current value of time will not fit in an object of type time_t." Add to RATIONALE on time() On some systems the time() function is implemented using a system call that does not return an error condition in addition to the return value. In this case it is impossible to differentiate between a valid and invalid return value and hence overflow conditions cannot be detected. |
|
|
When we progress this down the interpretations track, the accepted text needs to be updated to account for the comments made in reply to the minutes of the May 14 2009 teleconference: From: Geoff Clare <gwc@xxxxxxxxx> > On the time() page: > > Add a may fail case. > > Change: > "No errors are defined." > on P2107, L66673 in the ERRORS sections to: > "The time() function may fail if: > [EOVERFLOW] The current value of time will not fit in an > object of type time_t." With CX shading. From: Nick Stoughton <nick@xxxxxxxxx> > Add to clock_gettime Page 668 after line 22669 > > The clock_gettime() function shall fail if: > > [EOVERFLOW] The current value of time will not fit in an > object of type time_t." I think error condition this would be better worded as something like: "[EOVERFLOW] The number of seconds will not fit in an object of type time_t." The current value of time for this call includes the nanoseconds field ... so "the current value of time" will never fit in a time_t! |
|
|
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: ------------- None. Notes to the Editor (not part of this interpretation): ------------------------------------------------------- Add to the ERRORS section of clock_gettime() after P668, L22669: The clock_gettime() function shall fail if: [EOVERFLOW] The number of seconds will not fit in an object of type time_t." Change: No errors are defined. on P2107, L66673 in the ERRORS section of time() to: The time() function may fail if: [EOVERFLOW] The number of seconds since the Epoch will not fit in an object of type time_t. with CX shading. Add to the RATIONALE section of time() after P2108, L66718: On some systems the time() function is implemented using a system call that does not return an error condition in addition to the return value. On these systems it is impossible to differentiate between valid and invalid return values and hence overflow conditions cannot be reliably detected. |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2009-06-30 19:16 | msbrown | New Issue | |
| 2009-06-30 19:16 | msbrown | Status | New => Under Review |
| 2009-06-30 19:16 | msbrown | Assigned To | => ajosey |
| 2009-06-30 19:16 | msbrown | Name | => Mark Brown |
| 2009-06-30 19:16 | msbrown | Organization | => IBM |
| 2009-06-30 19:16 | msbrown | Section | => time() |
| 2009-06-30 19:16 | msbrown | Page Number | => 2107 |
| 2009-06-30 19:16 | msbrown | Line Number | => 66673 |
| 2009-06-30 19:18 | msbrown | Note Added: 0000140 | |
| 2009-06-30 19:18 | msbrown | Status | Under Review => Interpretation Required |
| 2009-06-30 19:18 | msbrown | Resolution | Open => Accepted As Marked |
| 2009-06-30 19:18 | msbrown | Final Accepted Text | => 0000106:0000140 |
| 2009-07-01 16:16 |
|
Name | Mark Brown => Don Cragun |
| 2009-07-01 16:16 |
|
Organization | IBM => Self |
| 2009-07-01 16:16 |
|
Reporter | msbrown => Don Cragun |
| 2009-07-10 11:30 | geoffclare | Note Added: 0000157 | |
| 2009-07-10 11:31 | geoffclare | Note Edited: 0000157 | |
| 2009-08-13 18:28 |
|
Interp Status | => --- |
| 2009-08-13 18:28 |
|
Note Added: 0000197 | |
| 2009-08-13 18:29 |
|
Final Accepted Text | 0000106:0000140 => 0000106:0000197 |
| 2009-08-13 18:31 |
|
Interp Status | --- => Pending |
| 2009-08-13 18:38 |
|
Note Edited: 0000197 | |
| 2009-09-17 15:41 | nick | Interp Status | Pending => Proposed |
| 2009-10-12 05:55 | ajosey | Note Edited: 0000197 | |
| 2009-10-12 05:55 | ajosey | Interp Status | Proposed => Approved |
| 2010-09-21 11:03 | geoffclare | Tag Attached: tc1-2008 | |
| 2013-04-16 13:06 | ajosey | Status | Interpretation Required => Closed |