On 12 July 2016 at 15:23, Ruediger Meier <sweet_f_a@xxxxxx> wrote: > On Tuesday 12 July 2016, Sami Kerola wrote: >> On 11 July 2016 at 21:23, J William Piggott <elseifthen@xxxxxxx> > wrote: >> > We use mktime(3) for portability. >> > >> > http://www.gnu.org/software/libc/manual/html_mono/libc.html#index-t >> >imegm >> > >> > Portability note: mktime is essentially universally available. >> > timegm is rather rare. For the most portable conversion from a UTC >> > broken-down time to a simple time, set the TZ environment variable >> > to UTC, call mktime, then set TZ back. >> >> I don't think hwclock(8) is portable. It has ioctl(2) calls, and >> such. > > But there are non-gnu libc's for Linux. Fair point, but can you name one that does not have timegm(). https://github.com/cloudius-systems/musl/blob/master/src/time/timegm.c https://github.com/ensc/dietlibc/blob/master/libugly/timegm.c http://www.uclibc-ng.org/browser/uclibc-ng/libc/misc/time/timegm.c?order=name -- Sami Kerola http://www.iki.fi/kerolasa/ -- To unsubscribe from this list: send the line "unsubscribe util-linux" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html