March 25, 2024
7:41 p.m.
"Clive D.W. Feather via tz" <tz@iana.org> writes:
Dag-Erling Smørgrav <des@des.no> writes:
[...] POSIX never guarantees that a successful call does not modify errno [...] Library functions and system calls never set errno to 0. So the usual answer is to set errno to 0 before the call and see if it's still 0 afterwards.
See above, and try this: struct tm tm = { .tm_mday = 1, .tm_year = 69 }; errno = 0; printf("%ld %d\n", mktime(&tm), errno); DES -- Dag-Erling Smørgrav - des@des.no