[OpenWrt-Devel] [PATCH] netifd: use the 64-bit version of clock_gettime
Rosen Penev
rosenp at gmail.com
Sun Mar 22 05:38:20 EDT 2020
On Sun, Mar 22, 2020 at 1:39 AM Hans Dedecker <dedeckeh at gmail.com> wrote:
>
> hi,
>
> On Fri, Mar 20, 2020 at 10:59 PM Rosen Penev <rosenp at gmail.com> wrote:
> >
> > Fixes compilation with musl 1.2.0 which removes this syscall.
> >
> > Signed-off-by: Rosen Penev <rosenp at gmail.com>
> > ---
> > system-linux.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/system-linux.c b/system-linux.c
> > index d533be8..902ab50 100644
> > --- a/system-linux.c
> > +++ b/system-linux.c
> > @@ -2421,7 +2421,7 @@ time_t system_get_rtime(void)
> > struct timespec ts;
> > struct timeval tv;
> >
> > - if (syscall(__NR_clock_gettime, CLOCK_MONOTONIC, &ts) == 0)
> > + if (syscall(__NR_clock_gettime64, CLOCK_MONOTONIC, &ts) == 0)
> > return ts.tv_sec;
> This breaks compilation on glibc
>
> /home/dedeckeh/WDR4300_glibc_staging/build_dir/target-mips_24kc_glibc/netifd-2020-02-05-dbdef938/system-linux.c:2424:14:
> error: '__NR_clock_gettime64' undeclared (first use in this function);
> did you mean 'SYS_clock_gettime'?
> if (syscall(__NR_clock_gettime64, CLOCK_MONOTONIC, &ts) == 0)
> ^~~~~~~~~~~~~~~~~~~~
> SYS_clock_gettime
lovely...
I guess it has to be converted to clock_gettime.
>
> Hans
> >
> > if (gettimeofday(&tv, NULL) == 0)
> > --
> > 2.24.1
> >
> >
> > _______________________________________________
> > openwrt-devel mailing list
> > openwrt-devel at lists.openwrt.org
> > https://lists.openwrt.org/mailman/listinfo/openwrt-devel
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel
More information about the openwrt-devel
mailing list