From: Rich Felker Date: Sat, 20 Jul 2019 21:02:49 +0000 (-0400) Subject: refactor adjtimex in terms of clock_adjtime X-Git-Tag: v1.1.24~112 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=107d68ad1737929a3e815bd28514cb56e4bedd57;p=oweals%2Fmusl.git refactor adjtimex in terms of clock_adjtime this sets the stage for having the conversion logic for 64-bit time_t all in one file, and as a bonus makes clock_adjtime for CLOCK_REALTIME work even on kernels too old to have the clock_adjtime syscall. --- diff --git a/src/linux/adjtimex.c b/src/linux/adjtimex.c index 91de6824..e9d727cf 100644 --- a/src/linux/adjtimex.c +++ b/src/linux/adjtimex.c @@ -1,7 +1,7 @@ #include -#include "syscall.h" +#include int adjtimex(struct timex *tx) { - return syscall(SYS_adjtimex, tx); + return clock_adjtime(CLOCK_REALTIME, tx); } diff --git a/src/linux/clock_adjtime.c b/src/linux/clock_adjtime.c index 056ad6d3..7d6b0349 100644 --- a/src/linux/clock_adjtime.c +++ b/src/linux/clock_adjtime.c @@ -1,7 +1,9 @@ #include +#include #include "syscall.h" int clock_adjtime (clockid_t clock_id, struct timex *utx) { + if (clock_id==CLOCK_REALTIME) return syscall(SYS_adjtimex, utx); return syscall(SYS_clock_adjtime, clock_id, utx); }