On Thu, 26 Nov 2009 08:59:44 +0100 Ulrich Mueller <u...@gentoo.org> wrote: > >> Not non-preservation. Partial and inconsistent corruption. > > > Wouldn't "loss of precision" be a more accurate description? > > Yes. Or even "rounding".
No, corruption, including of the seconds part, is the right way to describe it. > > Of the known packages which require timestamp preservation, do any > > of them use sub-second precision in their timestamp comparisons? > > I can speak for Emacs only, where the comparison code (in fileio.c) is > as follows: > > if (stat (SDATA (absname1), &st) < 0) > return Qnil; > > mtime1 = st.st_mtime; > > if (stat (SDATA (absname2), &st) < 0) > return Qt; > > return (mtime1 > st.st_mtime) ? Qt : Qnil; > > It uses stat(2), therefore nanoseconds are ignored. Uh, two things. First, Portage sometimes corrupts the second part too. Second, [1]: > For compatibility with earlier versions of this standard, the st_atime > macro shall be defined with the value st_atim.tv_sec. Similarly, > st_ctime and st_mtime shall be defined as macros with the values > st_ctim.tv_sec and st_mtim.tv_sec, respectively. Note that POSIX considers st_mtime to be legacy, and thinks you should be using st_mtim instead. Do you want this to break when Emacs starts following the newer standard, or do you want to get this right now so we won't have to have the discussion again a year later? [1]: http://www.opengroup.org/onlinepubs/9699919799/basedefs/sys_stat.h.html -- Ciaran McCreesh
signature.asc
Description: PGP signature