This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Ensure mktime sets errno on error (bug 23789)


On Thu, Oct 25, 2018 at 10:03 AM Albert ARIBAUD <albert.aribaud@3adev.fr> wrote:

> Hmm... Posix defines the value returned by mktime to be "Seconds since
> the Epoch" thus: <http://pubs.opengroup.org/onlinepubs/9699919799/>.
> According to this definition, a year below 1970 makes the corresponding
> seconds since the epoch value undefined, so I wonder whether the struct
> tm above is not outside the allowed limits for mktime().

That may be true per the letter of POSIX, but there are enough
programs that expect to be able to use negative time_t values to work
with dates prior to 1970 that glibc needs to support this usage
anyway.

zw


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]