bug-gnulib
[Top][All Lists]
Advanced

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

Re: new module stat-time, to ease access to sub-second file time stamps


From: Eric Blake
Subject: Re: new module stat-time, to ease access to sub-second file time stamps
Date: Fri, 16 Sep 2005 14:17:11 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Paul Eggert <eggert <at> CS.UCLA.EDU> writes:

> +++ m4/stat-time.m4   2005-09-15 22:39:57.000000000 -0700
> +dnl From Paul Eggert.
> +
> +# st_atim.tv_nsec - Linux, Solaris
> +# st_atimespec.tv_nsec - FreeBSD, if ! defined _POSIX_SOURCE
> +# st_atimensec - FreeBSD, if defined _POSIX_SOURCE
> +# st_atim.st__tim.tv_nsec - UnixWare (at least 2.1.2 through 7.1)
> +# st_spare1 - Cygwin?

Actually, I just looked at the cygwin source code.  Most systems that use 
newlib have struct stat with adjacent members.  No documentation is provided on 
the resolution of st_spare1, but I think it is usec:
...
 time_t st_atime;
 long   st_spare1;
 time_t st_mtime;
 long   st_spare2;
 time_t st_ctime;
 long   st_spare3;
...

But cygwin defines its own struct stat, with:
struct timestruc_t {
  time_t tv_sec;
  long   tv_nsec; /* nanos */
};
...
 timestruc_t st_atim;
 timestruc_t st_mtim;
 timestruc_t st_ctim;
...
#define st_atime st_atim.tv_sec
#define st_mtime st_mtim.tv_sec
#define st_ctime st_ctim.tv_sec

So your comment is out of date; cygwin is like Linux.  If st_spare1 is still in 
active use, it is probably for other newlib systems like mingw.

--
Eric Blake






reply via email to

[Prev in Thread] Current Thread [Next in Thread]