help-make
[Top][All Lists]
Advanced

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

Re: How to modify algorithm that determines weather a target needs rebu


From: David Boyce
Subject: Re: How to modify algorithm that determines weather a target needs rebuild
Date: Mon, 9 Aug 2010 09:46:56 -0400

On Mon, Aug 9, 2010 at 9:19 AM, Paul Smith <address@hidden> wrote:
> I think the plan was to use touch's -r option (or -t maybe) to set the
> timestamp to a specific time (that is, to the exact same time as the
> prereq file), rather than just setting the timestamp to "now".
>
> That should be pretty safe across all kinds of filesystems...

As I understand it even this runs into a Unix problem, which may have
been part of what Todd was alluding to. The POSIX API has a
fundamental flaw; though systems are allowed to track file times to
any granularity - Solaris, for instance, stores nanosecond file times
(though there may be some roundoff involved) - the system call to
"touch" a file to a particular time is utimes() which can only do
microseconds. Thus if you create file X and then "touch -r X Y" the
timestamps may not be equal; Y will be X rounded off to microseconds.

GNU make has a .LOW_RESOLUTION_TIME target which may help, but you're
already deep into the weeds here.

David Boyce



reply via email to

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