/[autoconf]/autoconf/doc/autoconf.texi
ViewVC logotype

Diff of /autoconf/doc/autoconf.texi

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.756 by akim, Wed Aug 27 07:29:30 2003 UTC revision 1.757 by eggert, Tue Sep 2 19:13:59 2003 UTC
# Line 10469  newline encoding. Line 10469  newline encoding.
10469  @item @command{cp}  @item @command{cp}
10470  @c ---------------  @c ---------------
10471  @prindex @command{cp}  @prindex @command{cp}
10472    @cindex timestamp resolution
10473    Traditionally, file timestamps had 1-second resolution, and @samp{cp
10474    -p} copied the timestamps exactly.  However, many modern filesystems
10475    have timestamps with 1-nanosecond resolution.  Unfortunately, @samp{cp
10476    -p} implementations truncate timestamps when copying files, so this
10477    can result in the destination file appearing to be older than the
10478    source.  The exact amount of truncation depends on the resolution of
10479    the system calls that @command{cp} uses; traditionally this was
10480    @code{utime}, which has 1-second resolution, but some newer
10481    @command{cp} implementations use @code{utimes}, which has
10482    1-microsecond resolution.  These newer implementations include GNU
10483    coreutils 5.0.91 or later, and Solaris 8 (sparc) patch 109933-02 or
10484    later.  Unfortunately as of September 2003 there is still no system
10485    call to set time stamps to the full nanosecond resolution.
10486    
10487  @c This is thanks to Ian.  @c This is thanks to Ian.
10488  SunOS @command{cp} does not support @option{-f}, although its  SunOS @command{cp} does not support @option{-f}, although its
10489  @command{mv} does.  It's possible to deduce why @command{mv} and  @command{mv} does.  It's possible to deduce why @command{mv} and
# Line 10989  s/.*/deleted/g Line 11004  s/.*/deleted/g
11004  @item @command{touch}  @item @command{touch}
11005  @c ------------------  @c ------------------
11006  @prindex @command{touch}  @prindex @command{touch}
11007    @cindex timestamp resolution
11008    If you specify the desired timestamp (e.g., with the @option{-r}
11009    option), @command{touch} typically uses the @code{utime} or
11010    @code{utimes} system call, which can result in the same kind of
11011    timestamp truncation problems that @samp{cp -p} has.
11012    
11013  On some old @acronym{BSD} systems, @command{touch} or any command that  On some old @acronym{BSD} systems, @command{touch} or any command that
11014  results in an empty file does not update the timestamps, so use a  results in an empty file does not update the timestamps, so use a
11015  command like @code{echo} as a workaround.  command like @code{echo} as a workaround.
# Line 11683  cp foo.in foo.out Line 11704  cp foo.in foo.out
11704  @end example  @end example
11705    
11706  As a result, in such a case, you have to write target rules.  As a result, in such a case, you have to write target rules.
11707    
11708    @item Timestamp Resolution
11709    @cindex timestamp resolution
11710    Traditionally, file timestamps had 1-second resolution, and
11711    @command{make} used those timestamps to determine whether one file was
11712    newer than the other.  However, many modern filesystems have
11713    timestamps with 1-nanosecond resolution.  Some @command{make}
11714    implementations look at the entire timestamp; others ignore the
11715    fractional part, which can lead to incorrect results.  Normally this
11716    is not a problem, but in some extreme cases you may need to use tricks
11717    like @samp{sleep 1} to work around timestamp truncation bugs.
11718    
11719    Commands like @samp{cp -p} and @samp{touch -r} typically do not copy
11720    file timestamps to their full resolutions (@pxref{Limitations of Usual
11721    Tools}).  Hence you should be wary of rules like this:
11722    
11723    @example
11724    dest: src
11725            cp -p src dest
11726    @end example
11727    
11728    as @file{dest} will often appear to be older than @file{src} after the
11729    timestamp is truncated, and this can cause @command{make} to do
11730    needless rework the next time it is invoked.  To work around this
11731    problem, you can use a timestamp file, e.g.:
11732    
11733    @example
11734    dest-stamp: src
11735            cp -p src dest
11736            date >dest-stamp
11737    @end example
11738    
11739  @end table  @end table
11740    
11741    

Legend:
Removed from v.1.756  
changed lines
  Added in v.1.757

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26