Mercurial > hg > octave-jordi > gnulib-hg
comparison m4/stat-time.m4 @ 8568:392970b32717
Support sub-second birthtime on cygwin.
* m4/stat-time.m4 (gl_STAT_BIRTHTIME): Also check for st_birthtim.
* lib/stat-time.h (STAT_TIMESPEC): Adjust comments.
(get_stat_birthtime): Also work with st_birthtim.
author | Eric Blake <ebb9@byu.net> |
---|---|
date | Tue, 27 Mar 2007 20:03:47 +0000 |
parents | f7fc3652bfc5 |
children | f6cba5a556ce |
comparison
equal
deleted
inserted
replaced
8567:f7fc3652bfc5 | 8568:392970b32717 |
---|---|
7 # gives unlimited permission to copy and/or distribute it, | 7 # gives unlimited permission to copy and/or distribute it, |
8 # with or without modifications, as long as this notice is preserved. | 8 # with or without modifications, as long as this notice is preserved. |
9 | 9 |
10 dnl From Paul Eggert. | 10 dnl From Paul Eggert. |
11 | 11 |
12 # st_atim.tv_nsec - Linux, Solaris | 12 # st_atim.tv_nsec - Linux, Solaris, Cygwin |
13 # st_atimespec.tv_nsec - FreeBSD, NetBSD, if ! defined _POSIX_SOURCE | 13 # st_atimespec.tv_nsec - FreeBSD, NetBSD, if ! defined _POSIX_SOURCE |
14 # st_atimensec - FreeBSD, NetBSD, if defined _POSIX_SOURCE | 14 # st_atimensec - FreeBSD, NetBSD, if defined _POSIX_SOURCE |
15 # st_atim.st__tim.tv_nsec - UnixWare (at least 2.1.2 through 7.1) | 15 # st_atim.st__tim.tv_nsec - UnixWare (at least 2.1.2 through 7.1) |
16 | 16 |
17 # st_birthtimespec - FreeBSD, NetBSD (hidden on OpenBSD 3.9, anyway) | 17 # st_birthtimespec - FreeBSD, NetBSD (hidden on OpenBSD 3.9, anyway) |
18 # st_birthtim - Cygwin 1.7.0+ | |
18 | 19 |
19 AC_DEFUN([gl_STAT_TIME], | 20 AC_DEFUN([gl_STAT_TIME], |
20 [ | 21 [ |
21 AC_REQUIRE([AC_C_INLINE]) | 22 AC_REQUIRE([AC_C_INLINE]) |
22 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) | 23 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) |
41 ], | 42 ], |
42 [ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=yes], | 43 [ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=yes], |
43 [ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=no])]) | 44 [ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=no])]) |
44 if test $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec = yes; then | 45 if test $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec = yes; then |
45 AC_DEFINE([TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC], 1, | 46 AC_DEFINE([TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC], 1, |
46 [Define to 1 if the type of the st_atim member of a struct stat is | 47 [Define to 1 if the type of the st_atim member of a struct stat is |
47 struct timespec.]) | 48 struct timespec.]) |
48 fi], | 49 fi], |
49 [AC_CHECK_MEMBERS([struct stat.st_atimespec.tv_nsec], [], | 50 [AC_CHECK_MEMBERS([struct stat.st_atimespec.tv_nsec], [], |
50 [AC_CHECK_MEMBERS([struct stat.st_atimensec], [], | 51 [AC_CHECK_MEMBERS([struct stat.st_atimensec], [], |
51 [AC_CHECK_MEMBERS([struct stat.st_atim.st__tim.tv_nsec], [], [], | 52 [AC_CHECK_MEMBERS([struct stat.st_atim.st__tim.tv_nsec], [], [], |
57 #include <sys/stat.h>])], | 58 #include <sys/stat.h>])], |
58 [#include <sys/types.h> | 59 [#include <sys/types.h> |
59 #include <sys/stat.h>]) | 60 #include <sys/stat.h>]) |
60 ]) | 61 ]) |
61 | 62 |
62 # Check for st_birthtime, a feature from UFS2 (FreeBSD, NetBSD, OpenBSD, etc.). | 63 # Check for st_birthtime, a feature from UFS2 (FreeBSD, NetBSD, OpenBSD, etc.) |
64 # and NTFS (Cygwin). | |
63 # There was a time when this field was named st_createtime (21 June | 65 # There was a time when this field was named st_createtime (21 June |
64 # 2002 to 16 July 2002) But that window is very small and applied only | 66 # 2002 to 16 July 2002) But that window is very small and applied only |
65 # to development code, so systems still using that configuration are | 67 # to development code, so systems still using that configuration are |
66 # not supported. See revisions 1.10 and 1.11 of FreeBSD's | 68 # not supported. See revisions 1.10 and 1.11 of FreeBSD's |
67 # src/sys/ufs/ufs/dinode.h. | 69 # src/sys/ufs/ufs/dinode.h. |
70 [ | 72 [ |
71 AC_REQUIRE([AC_C_INLINE]) | 73 AC_REQUIRE([AC_C_INLINE]) |
72 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) | 74 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) |
73 AC_CHECK_HEADERS_ONCE([sys/time.h]) | 75 AC_CHECK_HEADERS_ONCE([sys/time.h]) |
74 AC_CHECK_MEMBERS([struct stat.st_birthtimespec.tv_nsec], [], | 76 AC_CHECK_MEMBERS([struct stat.st_birthtimespec.tv_nsec], [], |
75 [AC_CHECK_MEMBERS([struct stat.st_birthtimensec], [], [], | 77 [AC_CHECK_MEMBERS([struct stat.st_birthtimensec], [], |
78 [AC_CHECK_MEMBERS([struct stat.st_birthtim.tv_nsec], [], [], | |
79 [#include <sys/types.h> | |
80 #include <sys/stat.h>])], | |
76 [#include <sys/types.h> | 81 [#include <sys/types.h> |
77 #include <sys/stat.h>])], | 82 #include <sys/stat.h>])], |
78 [#include <sys/types.h> | 83 [#include <sys/types.h> |
79 #include <sys/stat.h>]) | 84 #include <sys/stat.h>]) |
80 ]) | 85 ]) |