[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH glic] hurd: Add CLOCK_MONOTONIC case in clock_gettime()
From: |
Samuel Thibault |
Subject: |
Re: [RFC PATCH glic] hurd: Add CLOCK_MONOTONIC case in clock_gettime() |
Date: |
Thu, 2 Jan 2025 00:04:25 +0100 |
Hello,
Sergey Bugaev, le mer. 01 janv. 2025 12:50:48 +0300, a ecrit:
> On Wed, Jan 1, 2025 at 12:25 PM Zhaoming Luo <zhmingluo@163.com> wrote:
> >
> > ---
> > sysdeps/mach/clock_gettime.c | 12 ++++++++++++
> > 1 file changed, 12 insertions(+)
> >
> > diff --git a/sysdeps/mach/clock_gettime.c b/sysdeps/mach/clock_gettime.c
> > index 6fffad39f5..22faf85730 100644
> > --- a/sysdeps/mach/clock_gettime.c
> > +++ b/sysdeps/mach/clock_gettime.c
> > @@ -31,6 +31,18 @@ __clock_gettime (clockid_t clock_id, struct timespec *ts)
> >
> > switch (clock_id) {
> >
> > + case CLOCK_MONOTONIC:
> > + {
> > + /* __host_get_uptime64 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_value64_t tv;
> > + __host_get_uptime64 (__mach_host_self (), &tv);
>
> host_get_uptime64 was just added (by you) to gnumach, right? So what
> can quite likely happen is:
>
> - it's not present in the version of Mach that glibc is being built against
> - it's not present in the version of Mach that glibc is being run on
And also, when building glibc, you might have old gnumach.defs
without the RPC definition. Please add a mach_RPC_CHECK in
sysdeps/mach/configure.ac to condition your code addition, so the
upgrade will be smooth for everybody.
And as Sergey mentioned, cope with the kernel not having the support.
Samuel