summaryrefslogtreecommitdiff
path: root/m4/timespec.m4
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2000-01-04 17:12:12 +0000
committerJim Meyering <jim@meyering.net>2000-01-04 17:12:12 +0000
commitcdff473cd38ee52cf463f982d803fe3b84aa9bd8 (patch)
tree091e46515b37b7587dfbf4e596d69d1b6ad13046 /m4/timespec.m4
parent9a74f64d1244334c58942c0eda6527570ffad9d6 (diff)
downloadcoreutils-cdff473cd38ee52cf463f982d803fe3b84aa9bd8.tar.xz
*** empty log message ***
Diffstat (limited to 'm4/timespec.m4')
-rw-r--r--m4/timespec.m423
1 files changed, 23 insertions, 0 deletions
diff --git a/m4/timespec.m4 b/m4/timespec.m4
new file mode 100644
index 000000000..ad3e069f9
--- /dev/null
+++ b/m4/timespec.m4
@@ -0,0 +1,23 @@
+#serial 1
+
+dnl From Jim Meyering
+
+dnl Define HAVE_STRUCT_TIMESPEC if `struct timespec' is declared in time.h.
+
+AC_DEFUN(jm_CHECK_TYPE_STRUCT_TIMESPEC,
+[
+ AC_CACHE_CHECK([for struct timespec], fu_cv_sys_struct_timespec,
+ [AC_TRY_COMPILE(
+ [
+#include <time.h>
+ ],
+ [static struct timespec x; x.tv_sec = x.tv_nsec;],
+ fu_cv_sys_struct_timespec=yes,
+ fu_cv_sys_struct_timespec=no)
+ ])
+
+ if test $fu_cv_sys_struct_timespec = yes; then
+ AC_DEFINE_UNQUOTED(HAVE_STRUCT_TIMESPEC, 1,
+ [Define if struct timespec is declared in <time.h>. ])
+ fi
+])