Java Mailing List Archive

http://www.redhatconfig.com/

Home » Red Hat Linux Discussion »

Re: differences in the time precision used within linux can bite you

Cameron Simpson

2008-02-03

Replies:

Author LoginPost Reply
On 03Feb2008 14:13, mark <m.roth2006@(protected):
| krishnaakishore@(protected):
| > @Bruke: I don't think that is what he is referring to. The problem was
| > with preserving timestamps when the copy is being made.
| >
| > It has got something to do with struct timespec, struct timeval usage
| > may be. Just a guess.
|
| Here's a thought: could the cp be 32-bit code, and the timestamp struct shown
| by ls be 64-bit?

The time differences were well less than one second. UNIX generally uses 32
bit seconds, so you'd expect

Unless you're talking about the sub-second component being in 32 bits,
which would still suffice for nanoseconds.

A quick glance inside time.h shows a "struct timeval" with goes to
microseconds and a "struct timespec" that goes to nanoseconds.

If different code paths use each then this could readily produce the
behaviour reported. For example, if "cp" is using a struct timeval to
copy the time from the original file to the new one.

Cheers,
--
Cameron Simpson <cs@(protected)
http://www.cskk.ezoshosting.com/cs/

--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@(protected)
https://www.redhat.com/mailman/listinfo/redhat-list
©2008 redhatconfig.com - Jax Systems, LLC, U.S.A.