lkml.org 
[lkml]   [2004]   [Apr]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Linux 2.6 nanosecond time stamp weirdness breaks GCC build
From
Date
On Apr  1, 2004, Ulrich Weigand <weigand@i1.informatik.uni-erlangen.de> wrote:

> - STAMP = echo timestamp >
> + STAMP = sleep 1 >

I don't think this will fix the problem, at least not portably.

sleep 1 > filename

will truncate filename before sleep starts, modifying its timestamp at
that point, and leave it unchanged afterwards. Some systems might
update the timestamp again when the file truncated&opened for writing
is closed, but I don't think this is required. Worse yet: some
systems don't support empty files, and will error out because sleep 1
produced no output. Also, since some filesystems don't have 1-second
granularity, you should probably use `sleep 2' instead.

A more portable way to spell it would be:

STAMP = sleep 2; echo timestamp >

or, in order to make $(STAMP) usable in the middle of &&/|| sequences:

STAMP = { sleep 2; echo timestamp; } >

--
Alexandre Oliva http://www.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist oliva@{lsd.ic.unicamp.br, gnu.org}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:02    [W:0.078 / U:0.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site