time.2: Describe EOVERFLOW details

Heavily based on text proposed by Paul Eggert.

Cowritten-by: Paul Eggert <eggert@cs.ucla.edu>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2015-12-17 06:38:14 +01:00
parent da894b18a8
commit 4af94291ae
1 changed files with 21 additions and 0 deletions

View File

@ -82,6 +82,27 @@ and the Epoch, because of leap seconds and because system clocks are not
required to be synchronized to a standard reference. required to be synchronized to a standard reference.
The intention is that the interpretation of seconds since the Epoch values be The intention is that the interpretation of seconds since the Epoch values be
consistent; see POSIX.1-2008 Rationale A.4.15 for further rationale. consistent; see POSIX.1-2008 Rationale A.4.15 for further rationale.
On Linux, a call to
.BR time ()
with
.I t
specified as NULL cannot fail with the error
.BR EOVERFLOW ,
even on ABIs where
.I time_t
is a signed 32-bit integer and the clock ticks past the time 2**31
(2038-01-19 03:14:08 UTC, ignoring leap seconds).
(POSIX.1 permits, but does not require, the
.B EOVERFLOW
error in the case where the seconds since the Epoch will not fit in
.IR time_t .)
Instead, the behavior on Linux is undefined when the system time is out of the
.I time_t
range.
Applications intended to run after 2038 should use ABIs with
.I time_t
wider than 32 bits.
.SH BUGS .SH BUGS
Error returns from this system call are indistinguishable from Error returns from this system call are indistinguishable from
successful reports that the time is a few seconds successful reports that the time is a few seconds