The following issue has been UPDATED.
======================================================================
http://austingroupbugs.net/view.php?id=106
======================================================================
Reported By: msbrown
Assigned To: ajosey
======================================================================
Project: 1003.1(2008)/Issue 7
Issue ID: 106
Category: System Interfaces
Type: Omission
Severity: Objection
Priority: normal
Status: Interpretation Required
Name: Mark Brown
Organization: IBM
User Reference:
Section: time()
Page Number: 2107
Line Number: 66673
Final Accepted Text: http://austingroupbugs.net/view.php?id=106#c140
======================================================================
Date Submitted: 2009-06-30 19:16 UTC
Last Modified: 2009-06-30 19:18 UTC
======================================================================
Summary: 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."
======================================================================
----------------------------------------------------------------------
(0000140) msbrown (manager) - 2009-06-30 19:18
http://austingroupbugs.net/view.php?id=106#c140
----------------------------------------------------------------------
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.
|