Mercurial > gnulib
annotate m4/stat-time.m4 @ 17363:5a51fb7777a9
sys_select, sys_time: port 2013-01-30 Solaris 2.6 fix to Cygwin
Problem reported by Marco Atzeri in
<http://lists.gnu.org/archive/html/bug-gnulib/2013-03/msg00000.html>.
* lib/sys_select.in.h [HAVE_SYS_SELECT_H && _CYGWIN_SYS_TIME_H]:
Simply delegate to the system <sys/select.h> in this case too.
Also, pay attention to _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H only
if OSF/1, since otherwise Cygwin breaks, and it doesn't seem to
be needed on Solaris either.
* lib/sys_time.in.h [_CYGWIN_SYS_TIME_H]:
Simply delgate to the system <sys/time.h> in this case.
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Tue, 19 Mar 2013 09:08:47 -0700 |
parents | e542fd46ad6f |
children | 344018b6e5d7 |
rev | line source |
---|---|
6237
d81a8251a9b0
* MODULES.html.sh (File system functions): Add stat-time.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
1 # Checks for stat-related time functions. |
d81a8251a9b0
* MODULES.html.sh (File system functions): Add stat-time.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
2 |
17249
e542fd46ad6f
maint: update all copyright year number ranges
Eric Blake <eblake@redhat.com>
parents:
17052
diff
changeset
|
3 # Copyright (C) 1998-1999, 2001, 2003, 2005-2007, 2009-2013 Free Software |
7172
be9e01d008cb
Avoid the need for AC_LIBSOURCES in m4 macros.
Paul Eggert <eggert@cs.ucla.edu>
parents:
6471
diff
changeset
|
4 # Foundation, Inc. |
be9e01d008cb
Avoid the need for AC_LIBSOURCES in m4 macros.
Paul Eggert <eggert@cs.ucla.edu>
parents:
6471
diff
changeset
|
5 |
6237
d81a8251a9b0
* MODULES.html.sh (File system functions): Add stat-time.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
6 # This file is free software; the Free Software Foundation |
d81a8251a9b0
* MODULES.html.sh (File system functions): Add stat-time.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
7 # gives unlimited permission to copy and/or distribute it, |
d81a8251a9b0
* MODULES.html.sh (File system functions): Add stat-time.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
8 # with or without modifications, as long as this notice is preserved. |
d81a8251a9b0
* MODULES.html.sh (File system functions): Add stat-time.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
9 |
d81a8251a9b0
* MODULES.html.sh (File system functions): Add stat-time.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
10 dnl From Paul Eggert. |
d81a8251a9b0
* MODULES.html.sh (File system functions): Add stat-time.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
11 |
8568
392970b32717
Support sub-second birthtime on cygwin.
Eric Blake <ebb9@byu.net>
parents:
8567
diff
changeset
|
12 # st_atim.tv_nsec - Linux, Solaris, Cygwin |
8565
c49cf515502f
2007-03-27 Bruno Haible <bruno@clisp.org>
Bruno Haible <bruno@clisp.org>
parents:
7897
diff
changeset
|
13 # st_atimespec.tv_nsec - FreeBSD, NetBSD, if ! defined _POSIX_SOURCE |
c49cf515502f
2007-03-27 Bruno Haible <bruno@clisp.org>
Bruno Haible <bruno@clisp.org>
parents:
7897
diff
changeset
|
14 # st_atimensec - FreeBSD, NetBSD, if defined _POSIX_SOURCE |
6237
d81a8251a9b0
* MODULES.html.sh (File system functions): Add stat-time.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
15 # st_atim.st__tim.tv_nsec - UnixWare (at least 2.1.2 through 7.1) |
d81a8251a9b0
* MODULES.html.sh (File system functions): Add stat-time.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
16 |
8567
f7fc3652bfc5
* lib/stat-time.h (USE_BIRTHTIME): Remove.
Paul Eggert <eggert@cs.ucla.edu>
parents:
8565
diff
changeset
|
17 # st_birthtimespec - FreeBSD, NetBSD (hidden on OpenBSD 3.9, anyway) |
8568
392970b32717
Support sub-second birthtime on cygwin.
Eric Blake <ebb9@byu.net>
parents:
8567
diff
changeset
|
18 # st_birthtim - Cygwin 1.7.0+ |
8565
c49cf515502f
2007-03-27 Bruno Haible <bruno@clisp.org>
Bruno Haible <bruno@clisp.org>
parents:
7897
diff
changeset
|
19 |
6237
d81a8251a9b0
* MODULES.html.sh (File system functions): Add stat-time.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
20 AC_DEFUN([gl_STAT_TIME], |
d81a8251a9b0
* MODULES.html.sh (File system functions): Add stat-time.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
21 [ |
d81a8251a9b0
* MODULES.html.sh (File system functions): Add stat-time.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
22 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) |
7897
b7a83a69ac23
* MODULES.html.sh (Support for systems lacking POSIX:2001): New
Paul Eggert <eggert@cs.ucla.edu>
parents:
7172
diff
changeset
|
23 AC_CHECK_HEADERS_ONCE([sys/time.h]) |
6237
d81a8251a9b0
* MODULES.html.sh (File system functions): Add stat-time.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
24 |
6471
54a70822331f
* m4/stat-time.m4 (STATE_TIMESPEC, STAT_TIMESPEC_NS): Add check for
Paul Eggert <eggert@cs.ucla.edu>
parents:
6237
diff
changeset
|
25 AC_CHECK_MEMBERS([struct stat.st_atim.tv_nsec], |
54a70822331f
* m4/stat-time.m4 (STATE_TIMESPEC, STAT_TIMESPEC_NS): Add check for
Paul Eggert <eggert@cs.ucla.edu>
parents:
6237
diff
changeset
|
26 [AC_CACHE_CHECK([whether struct stat.st_atim is of type struct timespec], |
54a70822331f
* m4/stat-time.m4 (STATE_TIMESPEC, STAT_TIMESPEC_NS): Add check for
Paul Eggert <eggert@cs.ucla.edu>
parents:
6237
diff
changeset
|
27 [ac_cv_typeof_struct_stat_st_atim_is_struct_timespec], |
11929
0e6b6e9d54d0
Replace uses of obsolete autoconf macros in Jim's modules.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
11007
diff
changeset
|
28 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM( |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11929
diff
changeset
|
29 [[ |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11929
diff
changeset
|
30 #include <sys/types.h> |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11929
diff
changeset
|
31 #include <sys/stat.h> |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11929
diff
changeset
|
32 #if HAVE_SYS_TIME_H |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11929
diff
changeset
|
33 # include <sys/time.h> |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11929
diff
changeset
|
34 #endif |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11929
diff
changeset
|
35 #include <time.h> |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11929
diff
changeset
|
36 struct timespec ts; |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11929
diff
changeset
|
37 struct stat st; |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11929
diff
changeset
|
38 ]], |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11929
diff
changeset
|
39 [[ |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11929
diff
changeset
|
40 st.st_atim = ts; |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11929
diff
changeset
|
41 ]])], |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11929
diff
changeset
|
42 [ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=yes], |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11929
diff
changeset
|
43 [ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=no])]) |
6471
54a70822331f
* m4/stat-time.m4 (STATE_TIMESPEC, STAT_TIMESPEC_NS): Add check for
Paul Eggert <eggert@cs.ucla.edu>
parents:
6237
diff
changeset
|
44 if test $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec = yes; then |
11007
f6cba5a556ce
many *.m4 files: improve m4 quoting
Jim Meyering <meyering@redhat.com>
parents:
8568
diff
changeset
|
45 AC_DEFINE([TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC], [1], |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11929
diff
changeset
|
46 [Define to 1 if the type of the st_atim member of a struct stat is |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11929
diff
changeset
|
47 struct timespec.]) |
6471
54a70822331f
* m4/stat-time.m4 (STATE_TIMESPEC, STAT_TIMESPEC_NS): Add check for
Paul Eggert <eggert@cs.ucla.edu>
parents:
6237
diff
changeset
|
48 fi], |
6237
d81a8251a9b0
* MODULES.html.sh (File system functions): Add stat-time.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
49 [AC_CHECK_MEMBERS([struct stat.st_atimespec.tv_nsec], [], |
d81a8251a9b0
* MODULES.html.sh (File system functions): Add stat-time.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
50 [AC_CHECK_MEMBERS([struct stat.st_atimensec], [], |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11929
diff
changeset
|
51 [AC_CHECK_MEMBERS([struct stat.st_atim.st__tim.tv_nsec], [], [], |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11929
diff
changeset
|
52 [#include <sys/types.h> |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11929
diff
changeset
|
53 #include <sys/stat.h>])], |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11929
diff
changeset
|
54 [#include <sys/types.h> |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11929
diff
changeset
|
55 #include <sys/stat.h>])], |
6237
d81a8251a9b0
* MODULES.html.sh (File system functions): Add stat-time.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
56 [#include <sys/types.h> |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11929
diff
changeset
|
57 #include <sys/stat.h>])], |
6237
d81a8251a9b0
* MODULES.html.sh (File system functions): Add stat-time.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
58 [#include <sys/types.h> |
d81a8251a9b0
* MODULES.html.sh (File system functions): Add stat-time.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
59 #include <sys/stat.h>]) |
d81a8251a9b0
* MODULES.html.sh (File system functions): Add stat-time.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
60 ]) |
8565
c49cf515502f
2007-03-27 Bruno Haible <bruno@clisp.org>
Bruno Haible <bruno@clisp.org>
parents:
7897
diff
changeset
|
61 |
8568
392970b32717
Support sub-second birthtime on cygwin.
Eric Blake <ebb9@byu.net>
parents:
8567
diff
changeset
|
62 # Check for st_birthtime, a feature from UFS2 (FreeBSD, NetBSD, OpenBSD, etc.) |
392970b32717
Support sub-second birthtime on cygwin.
Eric Blake <ebb9@byu.net>
parents:
8567
diff
changeset
|
63 # and NTFS (Cygwin). |
8567
f7fc3652bfc5
* lib/stat-time.h (USE_BIRTHTIME): Remove.
Paul Eggert <eggert@cs.ucla.edu>
parents:
8565
diff
changeset
|
64 # There was a time when this field was named st_createtime (21 June |
f7fc3652bfc5
* lib/stat-time.h (USE_BIRTHTIME): Remove.
Paul Eggert <eggert@cs.ucla.edu>
parents:
8565
diff
changeset
|
65 # 2002 to 16 July 2002) But that window is very small and applied only |
f7fc3652bfc5
* lib/stat-time.h (USE_BIRTHTIME): Remove.
Paul Eggert <eggert@cs.ucla.edu>
parents:
8565
diff
changeset
|
66 # to development code, so systems still using that configuration are |
f7fc3652bfc5
* lib/stat-time.h (USE_BIRTHTIME): Remove.
Paul Eggert <eggert@cs.ucla.edu>
parents:
8565
diff
changeset
|
67 # not supported. See revisions 1.10 and 1.11 of FreeBSD's |
f7fc3652bfc5
* lib/stat-time.h (USE_BIRTHTIME): Remove.
Paul Eggert <eggert@cs.ucla.edu>
parents:
8565
diff
changeset
|
68 # src/sys/ufs/ufs/dinode.h. |
8565
c49cf515502f
2007-03-27 Bruno Haible <bruno@clisp.org>
Bruno Haible <bruno@clisp.org>
parents:
7897
diff
changeset
|
69 # |
c49cf515502f
2007-03-27 Bruno Haible <bruno@clisp.org>
Bruno Haible <bruno@clisp.org>
parents:
7897
diff
changeset
|
70 AC_DEFUN([gl_STAT_BIRTHTIME], |
c49cf515502f
2007-03-27 Bruno Haible <bruno@clisp.org>
Bruno Haible <bruno@clisp.org>
parents:
7897
diff
changeset
|
71 [ |
c49cf515502f
2007-03-27 Bruno Haible <bruno@clisp.org>
Bruno Haible <bruno@clisp.org>
parents:
7897
diff
changeset
|
72 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) |
c49cf515502f
2007-03-27 Bruno Haible <bruno@clisp.org>
Bruno Haible <bruno@clisp.org>
parents:
7897
diff
changeset
|
73 AC_CHECK_HEADERS_ONCE([sys/time.h]) |
8567
f7fc3652bfc5
* lib/stat-time.h (USE_BIRTHTIME): Remove.
Paul Eggert <eggert@cs.ucla.edu>
parents:
8565
diff
changeset
|
74 AC_CHECK_MEMBERS([struct stat.st_birthtimespec.tv_nsec], [], |
8568
392970b32717
Support sub-second birthtime on cygwin.
Eric Blake <ebb9@byu.net>
parents:
8567
diff
changeset
|
75 [AC_CHECK_MEMBERS([struct stat.st_birthtimensec], [], |
392970b32717
Support sub-second birthtime on cygwin.
Eric Blake <ebb9@byu.net>
parents:
8567
diff
changeset
|
76 [AC_CHECK_MEMBERS([struct stat.st_birthtim.tv_nsec], [], [], |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11929
diff
changeset
|
77 [#include <sys/types.h> |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11929
diff
changeset
|
78 #include <sys/stat.h>])], |
8565
c49cf515502f
2007-03-27 Bruno Haible <bruno@clisp.org>
Bruno Haible <bruno@clisp.org>
parents:
7897
diff
changeset
|
79 [#include <sys/types.h> |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11929
diff
changeset
|
80 #include <sys/stat.h>])], |
8565
c49cf515502f
2007-03-27 Bruno Haible <bruno@clisp.org>
Bruno Haible <bruno@clisp.org>
parents:
7897
diff
changeset
|
81 [#include <sys/types.h> |
c49cf515502f
2007-03-27 Bruno Haible <bruno@clisp.org>
Bruno Haible <bruno@clisp.org>
parents:
7897
diff
changeset
|
82 #include <sys/stat.h>]) |
c49cf515502f
2007-03-27 Bruno Haible <bruno@clisp.org>
Bruno Haible <bruno@clisp.org>
parents:
7897
diff
changeset
|
83 ]) |