coreutils
[Top][All Lists]
Advanced

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

Re: [coreutils] [PATCH 2/2] stat: print timestamps to full resolution


From: Eric Blake
Subject: Re: [coreutils] [PATCH 2/2] stat: print timestamps to full resolution
Date: Fri, 01 Oct 2010 09:19:09 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.9) Gecko/20100921 Fedora/3.1.4-1.fc13 Mnenhy/0.8.3 Thunderbird/3.1.4

On 10/01/2010 09:03 AM, Eric Blake wrote:
time_t can be a float on weird platforms I think?

If you use nstrftime, no one can complain ;-)

Correct - time_t need not be integral, but do we have any proof of a
system using a floating-point time_t?

My understanding of POSIX is that time_t was permitted to be floating point to allow for subsecond resolution in early versions of the standard, in earlier versions of the standard where there was no other required support for subsecond resolution (that is, by being weasel-wordy about whether time_t was an integer, it was possible to do a weirdnix implementation that improved QoI by using floating-point time_t). But now that POSIX 2008 uniformly requires subsecond resolution via struct timespec, it makes less sense to have a floating-point time_t with a fractional value alongside the tv_nsec fractional value.

I think I'm going to write a POSIX bug requesting that time_t be tightened to integral in light of the fact that subsecond support is now uniformly guaranteed via tv_nsec, and given the argument that existing platforms never took advantage of float time_t.

--
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]