Hello Michael,
On 2011/04/08 18:48, Michael Stahl wrote:
i've just checked on Solaris 11 express:
both /usr/gnu/bin/cp [cp (GNU coreutils) 8.5] and /usr/bin/touch -r seem
to support nano-second timestamps.
Thanks to your inputs, everything has become clear.
Source code of the combined "mv/cp/ln" command bundled in OpenSolaris:
http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/mv/mv.c?a=true#1330
The recent code uses a newly created utimensat() system call, which accepts
nanoseconds, to assign time stamps to a file.
rc = utimensat(AT_FDCWD, to, times, 0);
Meanwhile, an old code uses utimes() system call which takes microseconds.
rc = utimes(to, times);
There was an obvious code there:
/*
* nanoseconds are rounded off to microseconds by flooring.
*/
static void
timestruc_to_timeval(timestruc_t *ts, struct timeval *tv)
{
tv->tv_sec = ts->tv_sec;
tv->tv_usec = ts->tv_nsec / 1000;
}
http://src.opensolaris.org/source/diff/onnv/onnv-gate/usr/src/cmd/mv/mv.c?r2=%2Fonnv%2Fonnv-gate%2Fusr%2Fsrc%2Fcmd%2Fmv%2Fmv.c%4010709%3A62c8735e37aa&r1=%2Fonnv%2Fonnv-gate%2Fusr%2Fsrc%2Fcmd%2Fmv%2Fmv.c%4010294%3Ab85a363540de
$ cat /etc/release
Solaris Express Community Edition snv_107 X86
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
Use is subject to license terms.
Assembled 26 January 2009
The OS that I am currently using shown above seems not to have the utimensat()
system call yet.
Best regards,
Tora
--
-----------------------------------------------------------------
To unsubscribe send email to dev-unsubscr...@openoffice.org
For additional commands send email to sy...@openoffice.org
with Subject: help