summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2021-12-28 11:38:33 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2021-12-28 12:04:49 -0800
commit0f42dafa9e0a8dab8d6f97dd70967cb3d8a922da (patch)
tree94a00ffea76a4a8332d53cebe4fd3af51b56899c /m4
parent1793603398ab356d73898d75d5669e2378179170 (diff)
downloadgnulib-0f42dafa9e0a8dab8d6f97dd70967cb3d8a922da.tar.gz
gettime-res: new module
* lib/gettime-res.c, modules/gettime-res: New files. * lib/timespec.h (gettime_res): New decl. * m4/clock_time.m4 (gl_CLOCK_TIME): Also check for clock_getres. * m4/gettime.m4 (gl_GETTIME_RES): New macro.
Diffstat (limited to 'm4')
-rw-r--r--m4/clock_time.m47
-rw-r--r--m4/gettime.m410
2 files changed, 13 insertions, 4 deletions
diff --git a/m4/clock_time.m4 b/m4/clock_time.m4
index c3b9e7ea40..543099c987 100644
--- a/m4/clock_time.m4
+++ b/m4/clock_time.m4
@@ -1,10 +1,11 @@
-# clock_time.m4 serial 10
+# clock_time.m4 serial 11
dnl Copyright (C) 2002-2006, 2009-2021 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
-# Check for clock_gettime and clock_settime, and set LIB_CLOCK_GETTIME.
+# Check for clock_getres, clock_gettime and clock_settime,
+# and set LIB_CLOCK_GETTIME.
# For a program named, say foo, you should add a line like the following
# in the corresponding Makefile.am file:
# foo_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME)
@@ -26,6 +27,6 @@ AC_DEFUN([gl_CLOCK_TIME],
AC_SEARCH_LIBS([clock_gettime], [rt posix4],
[test "$ac_cv_search_clock_gettime" = "none required" ||
LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime])
- AC_CHECK_FUNCS([clock_gettime clock_settime])
+ AC_CHECK_FUNCS([clock_getres clock_gettime clock_settime])
LIBS=$gl_saved_libs
])
diff --git a/m4/gettime.m4 b/m4/gettime.m4
index cb58bc8ebd..43447f28e5 100644
--- a/m4/gettime.m4
+++ b/m4/gettime.m4
@@ -1,4 +1,4 @@
-# gettime.m4 serial 10
+# gettime.m4 serial 11
dnl Copyright (C) 2002, 2004-2006, 2009-2021 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -11,3 +11,11 @@ AC_DEFUN([gl_GETTIME],
AC_REQUIRE([gl_TIMESPEC])
AC_CHECK_FUNCS_ONCE([timespec_get])
])
+
+AC_DEFUN([gl_GETTIME_RES],
+[
+ dnl Prerequisites of lib/gettime-res.c.
+ AC_REQUIRE([gl_CLOCK_TIME])
+ AC_REQUIRE([gl_TIMESPEC])
+ AC_CHECK_FUNCS_ONCE([timespec_getres])
+])