[tz] POSIX epoch in the news?
Brian.Inglis at systematicsw.ab.ca
Mon Feb 15 13:34:57 UTC 2016
On 2016-02-15 04:43, Guy Harris wrote:
> On Feb 15, 2016, at 3:16 AM, Tony Finch <dot at dotat.at> wrote:
> Somebody should inform Mr. or Ms. fpgaminer that there's a Mach layer below the BSD layer, and it uses *unsigned* seconds and microseconds, so that he or she understands why statements such as "... iOS likely is _not_ using u64. It's a BSD derivative, so it's using time_t, which is signed." are based on an incorrect assumption.
I would hope by now that Mach is using POSIX standard struct timespec in ns rather than still using the old struct timeval in us.
I can appreciate why OS internals would prefer unsigned times, but many(/most/all?) hosted libraries use signed time_t so apps can easily use times before the epoch.
Given that the standard error value is -1, it is not unreasonably naive to conclude that time_t is intended to be signed, and libc variants using GCC normally define time_t as signed.
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada
More information about the tz