aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/mach/configure
diff options
context:
space:
mode:
authorZhaoming Luo <zhmingluo@163.com>2025-01-06 12:39:07 +0800
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2025-01-12 22:47:00 +0100
commit3782ffaf3e6c2a071df029b96712e596b5229838 (patch)
treee50d8f1eaea004c0a84e8d32382a15de7b9245a8 /sysdeps/mach/configure
parent73b854e955a3c38655fa51f742238dc7163b4a29 (diff)
downloadglibc-3782ffaf3e6c2a071df029b96712e596b5229838.zip
glibc-3782ffaf3e6c2a071df029b96712e596b5229838.tar.gz
glibc-3782ffaf3e6c2a071df029b96712e596b5229838.tar.bz2
mach: Add CLOCK_MONOTONIC case in clock_gettime()
The Mach RPC host_get_uptime64() is implemented. It returns the elapsed time value since bootup. See https://git.savannah.gnu.org/cgit/hurd/gnumach.git/commit/?id=fc494bfe3fb6363e1077dc035eb119970d84a9d1 In this patch, the RPC is used to implement the monotonic clock for mach. * config.h.in: Add HAVE_HOST_GET_UPTIME64 config entry * sysdeps/mach/clock_gettime.c: Add CLOCK_MONOTONIC case * sysdeps/mach/configure: Check the existence of host_get_uptime64 RPC * sysdeps/mach/configure.ac: Check the existence of host_get_uptime64 RPC Message-ID: <20250106043907.1046-1-zhmingluo@163.com>
Diffstat (limited to 'sysdeps/mach/configure')
-rw-r--r--sysdeps/mach/configure30
1 files changed, 30 insertions, 0 deletions
diff --git a/sysdeps/mach/configure b/sysdeps/mach/configure
index abfe084..8aa6bbb 100644
--- a/sysdeps/mach/configure
+++ b/sysdeps/mach/configure
@@ -461,6 +461,36 @@ if test $libc_cv_mach_rpc_host_page_size = yes; then
fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for host_get_uptime64 in mach_host.defs" >&5
+printf %s "checking for host_get_uptime64 in mach_host.defs... " >&6; }
+if test ${libc_cv_mach_rpc_host_get_uptime64+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <mach/mach_host.defs>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP_TRADITIONAL "host_get_uptime64" >/dev/null 2>&1
+then :
+ libc_cv_mach_rpc_host_get_uptime64=yes
+else case e in #(
+ e) libc_cv_mach_rpc_host_get_uptime64=no ;;
+esac
+fi
+rm -rf conftest*
+ ;;
+esac
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_mach_rpc_host_get_uptime64" >&5
+printf "%s\n" "$libc_cv_mach_rpc_host_get_uptime64" >&6; }
+if test $libc_cv_mach_rpc_host_get_uptime64 = yes; then
+ printf "%s\n" "#define HAVE_HOST_GET_UPTIME64 1" >>confdefs.h
+
+fi
+
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for thread_set_name in gnumach.defs" >&5
printf %s "checking for thread_set_name in gnumach.defs... " >&6; }
if test ${libc_cv_mach_rpc_thread_set_name+y}