[PATCH] mach: Use the host_get_time64 to replace the deprecated host_get_time for CLOCK_REALTIME

Zhaoming Luo zhmingluo@163.com
Sun Mar 23 01:50:33 GMT 2025


Use the host_get_time64 to replace the deprecated host_get_time for
CLOCK_REALTIME.

See https://git.savannah.gnu.org/cgit/hurd/gnumach.git/commit/?id=569df850cd7badd1e36132ad3b44aa76a4d27c25

---
 sysdeps/mach/clock_gettime.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sysdeps/mach/clock_gettime.c b/sysdeps/mach/clock_gettime.c
index 381ccb84..043a985c 100644
--- a/sysdeps/mach/clock_gettime.c
+++ b/sysdeps/mach/clock_gettime.c
@@ -57,13 +57,13 @@ __clock_gettime (clockid_t clock_id, struct timespec *ts)
 
     case CLOCK_REALTIME:
       {
-	/* __host_get_time can only fail if passed an invalid host_t.
+	/* __host_get_time64 can only fail if passed an invalid host_t.
 	   __mach_host_self could theoretically fail (producing an
 	   invalid host_t) due to resource exhaustion, but we assume
 	   this will never happen.  */
-	time_value_t tv;
-	__host_get_time (__mach_host_self (), &tv);
-	TIME_VALUE_TO_TIMESPEC (&tv, ts);
+	time_value64_t tv;
+	__host_get_time64 (__mach_host_self (), &tv);
+	TIME_VALUE64_TO_TIMESPEC (&tv, ts);
 	return 0;
       }
 
-- 
2.47.2



More information about the Libc-alpha mailing list