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

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

 



On 03Feb2008 14:13, mark <m.roth2006@xxxxxxx> wrote:
| krishnaakishore@xxxxxxxxx wrote:
| > @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@xxxxxxxxxx> DoD#743
http://www.cskk.ezoshosting.com/cs/

-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux