bug-gnulib
[Top][All Lists]
Advanced

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

Re: test for utimes, utimens test, glibc futimes()


From: Paul Eggert
Subject: Re: test for utimes, utimens test, glibc futimes()
Date: Thu, 11 Nov 2010 16:18:53 -0800
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.12) Gecko/20101027 Thunderbird/3.1.6

On 11/11/2010 03:45 PM, Eric Blake wrote:
> On 11/11/2010 04:32 PM, Bruno Haible wrote:
>>   - Is glibc's futimes() implementation correct? Is futimes() allowed to 
>> round
>>     up by as much as half a second?
> 
> No.

Eric is right.  The POSIX spec for futimens, utimensat, and utimes says
"The file's relevant timestamp shall be set to the greatest value
supported by the file system that is not greater than the specified time".
POSIX doesn't govern futimes but it is clearly a bug if futimes behaves
differently from the standard functions in this respect.

I assume that the workaround is to stat the file on potentially-buggy systems, 
and
to redo the futimes call if it appears to have triggered the bug.  What a
hassle.

It's plausible that futimesat and lutimes would have the same bug as futimes.

The glibc bug was introduced in 2003.  I reported it back then;
see <http://sources.redhat.com/ml/libc-alpha/2003-08/msg00062.html>.
The bug was fixed in Debian; see
<http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=202243>.
It'd be nice if someone would fix it in glibc upstream, too.



reply via email to

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