timegm(3): behavior is not described in case of error

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

 



In the timegm(3) man page, the behavior is not described in case of
error, i.e. if the result is not representable in a time_t (e.g.,
with a huge year).

The glibc manual says:

     'timegm' is functionally identical to 'mktime' except it always
     takes the input values to be Coordinated Universal Time (UTC)
     regardless of any local time zone setting.

So, I assume that (time_t) -1 is returned in such a case, just like
mktime.

The man page could add a sentence like the glibc manual one, or
explicitly say what happens in case of error like in the mktime(3)
man page.

This is mainly for the timegm() function. For the timelocal() function,
the man page already says:

    The timelocal() function is equivalent to the POSIX standard
    function mktime(3). [...]

-- 
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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