diff options
author | Bruno Haible <bruno@clisp.org> | 2007-03-27 11:01:11 +0000 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2007-03-27 11:01:11 +0000 |
commit | 735c00a2f3a5ce7aaec8517f5438ce37b48a936c (patch) | |
tree | 41cc9b8d0367ee93915f67063e82eb6d3769b010 /m4 | |
parent | 6997174ab598e752b1a66d9928aaae871c1700db (diff) | |
download | gnulib-735c00a2f3a5ce7aaec8517f5438ce37b48a936c.tar.gz |
2007-03-27 Bruno Haible <bruno@clisp.org>
* lib/stat-time.h: Include <sys/stat.h>.
2007-03-27 James Youngman <jay@gnu.org>
* lib/stat-time.h (get_stat_birthtime): New function for
retrieving st_birthtime as provided by UFS2 (hence *BSD).
* m4/stat-time.m4 (gl_STAT_BIRTHTIME): Probe for st_birthtime
and its variants.
* modules/stat-time (configure.ac): call gl_STAT_BIRTHTIME.
* modules/stat-time-test: New file.
* tests/test-stat-time.c: New test, devised by Bruno Haible.
Diffstat (limited to 'm4')
-rw-r--r-- | m4/stat-time.m4 | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/m4/stat-time.m4 b/m4/stat-time.m4 index 353de213f9..6b98dd73cc 100644 --- a/m4/stat-time.m4 +++ b/m4/stat-time.m4 @@ -10,11 +10,13 @@ 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_atimespec.tv_nsec - FreeBSD, NetBSD, if ! defined _POSIX_SOURCE +# st_atimensec - FreeBSD, NetBSD, if defined _POSIX_SOURCE # st_atim.st__tim.tv_nsec - UnixWare (at least 2.1.2 through 7.1) # st_spare1 - Cygwin? +# st_birthtimespec present on NetBSD (probably also FreBSD, OpenBSD) + AC_DEFUN([gl_STAT_TIME], [ AC_REQUIRE([AC_C_INLINE]) @@ -61,3 +63,26 @@ AC_DEFUN([gl_STAT_TIME], [#include <sys/types.h> #include <sys/stat.h>]) ]) + +# Checks for st_birthtime, which is a feature from UFS2 (FreeBSD, NetBSD, OpenBSD, etc.) +# There was a time when this field was named st_createtime (21 June 2002 to 16 July 2002) +# But that window is very small and applied only to development code, so systems still +# using that configuration are not a realistic development target. +# See revisions 1.10 and 1.11 of FreeBSD's src/sys/ufs/ufs/dinode.h. +# +AC_DEFUN([gl_STAT_BIRTHTIME], +[ + AC_REQUIRE([AC_C_INLINE]) + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + AC_CHECK_HEADERS_ONCE([sys/time.h]) + AC_CHECK_MEMBERS([struct stat.st_birthtimespec.tv_sec, struct stat.st_birthtimespec.tv_nsec], [], + [AC_CHECK_MEMBERS([struct stat.st_birthtime, struct stat.st_birthtimensec], [], + [AC_CHECK_MEMBERS([struct stat.st_spare4], [], + [], + [#include <sys/types.h> + #include <sys/stat.h>])], + [#include <sys/types.h> + #include <sys/stat.h>])], + [#include <sys/types.h> + #include <sys/stat.h>]) +]) |