Re: [PATCH] ctime.3: mktime() may modify tm_hour due to tm_isdst

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Josepf and Paul,

On 10/12/21 12:05 AM, Joseph Myers wrote:
On Mon, 11 Oct 2021, Paul Eggert wrote:

On 10/11/21 3:27 AM, Alejandro Colomar (man-pages) wrote:
timegm(3) says that you should "avoid their use" because timegm(3) is a
Linux and BSD extension, but its use can NOT be avoided (well, it can, but
if not done very carefully, you are likely to introduce bugs due to
setenv(3) not being thread-safe), so I'd remove that sentence from
timegm(3).  I think it should be in POSIX.

No, NetBSD's mktime_z should be in POSIX, as it nicely generalizes both mktime
and timegm.

Hmm, I didn´t know that one either... Yes, it seems a nicer interface (and can be used to implement both mktime and timegm).

I'd still remove the warning against timegm(3) in the man page, though.


Arguably ISO C (there's no obvious dependence on any concepts that are in
scope of POSIX but not of ISO C), but we're now past the deadline to
request document numbers for proposals to C23 (and while there's a
proposal to add timegm, there's no proposal to add functions using
explicit time zones).


Yes.

On 10/11/21 5:37 PM, Paul Eggert wrote:
> mktime_z should also be in glibc, but that's another story....

BTW, I started implementing mktime_z(3) in my library, based mostly on glibc's mktime(3) code. When I have something working, I'll tell you in case you want to pick it for glibc.

Cheers,

Alex

--
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/



[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux