This is the mail archive of the
mailing list for the glibc project.
Re: [PATCH] Ensure mktime sets errno on error (bug 23789)
On Thu, Oct 25, 2018 at 10:03 AM Albert ARIBAUD <firstname.lastname@example.org> 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