[Top][All Lists]

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

Re: avoid a 1-second sleep in every configure script

From: Olly Betts
Subject: Re: avoid a 1-second sleep in every configure script
Date: Wed, 5 Aug 2009 09:05:14 +0000 (UTC)
User-agent: slrn/pre1.0.0-2 (Linux)

On 2009-07-30, Jim Meyering <address@hidden> wrote:
> I noticed (by inspection, since I was looking at AM_SANITY_CHECK)
> the unconditional 1-second sleep in coreutils' configure script,
> and realized that it'd be easy to avoid it on modern systems:
> either because configure was created more than a second before,
> or because the file system supports subsecond time stamps.

The first case is a nice gain, especially as it's likely to be the case for
most invocations of configure.

But in the latter case, what if stat is available, and the filesystem supports
subsecond granularity, but ls only works to the second?  Say coreutils is
installed in a director later in PATH, so stat comes from coreutils but ls
is the system one.

It seems that the stat test would be fine, but then "ls -t" would see the files
as having the same time stamp, and then the ordering depends on how you invoke

$ cd /tmp
$ touch configure conftest.file
$ ls -t ./configure conftest.file 
./configure  conftest.file
$ ls -t /tmp/configure conftest.file 
conftest.file  /tmp/configure

In the latter case, configure would report that newly created files were older
than distributed ones, although rerunning it more than a second later would
magically work.

Or perhaps there simply aren't systems where a filesystem supports subsecond
granularity and coreutils can handle this but the system ls doesn't, making
this a rather theoretical worry.


reply via email to

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