This is the mail archive of the
mailing list for the glibc project.
Re: The time(2) man page conflicts with glibc
- From: Paul Eggert <eggert at cs dot ucla dot edu>
- To: Zack Weinberg <zackw at panix dot com>, "Michael Kerrisk (man-pages)" <mtk dot manpages at gmail dot com>
- Cc: "H.J. Lu" <hjl dot tools at gmail dot com>, Andreas Schwab <schwab at suse dot de>, libc-alpha <libc-alpha at sourceware dot org>, linux-man <linux-man at vger dot kernel dot org>, Mike Frysinger <vapier at gentoo dot org>
- Date: Wed, 16 Dec 2015 15:05:26 -0800
- Subject: Re: The time(2) man page conflicts with glibc
- Authentication-results: sourceware.org; auth=none
- References: <CAMe9rOoJLk8VzyJKmkOvbmBxhCj4mVA2huYtHJsdxpatbkgJ1g at mail dot gmail dot com> <mvmegen94qs dot fsf at hawking dot suse dot de> <CAMe9rOr_Ydg5Nr7aV8vS0vYEFehSwFBuxrMAnCFXyyVoTF4vJQ at mail dot gmail dot com> <5671696B dot 3070203 at gmail dot com> <CAMe9rOqsxCEia7OWqzJ-HzZWCra5BTyYqt4japjZTw0pY=fugw at mail dot gmail dot com> <56717032 dot 7000007 at gmail dot com> <CAKCAbMjrKfsT7P=Q=+1zWC68552aK=ciod0HYk3=HWMvkYW26w at mail dot gmail dot com>
Zack Weinberg wrote:
When `t` is NULL, the call cannot fail.
This doesn't make it clear what happens when the time_t values roll around after
the year 2038, on 32-bit time_t hosts. How about adding some further text along
the following lines?
In GNU/Linux time(NULL) cannot fail with errno == EOVERFLOW, even on ABIs where
time_t is a signed 32-bit integer and when the clock ticks past the time 2**31
(2038-01-19 03:14:08 UTC, ignoring leap seconds). Instead, the behavior is
undefined when the system time is out of time_t range. Applications intended to
run after 2038 should use ABIs with time_t wider than 32 bits.