From 203458d4ea717af1662f5a196e1b093f6efe852f Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sun, 11 Aug 2024 15:41:07 -0500 Subject: [PATCH] Build hwclock when gettimeofday() syscall unavailable. --- toys/other/hwclock.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/toys/other/hwclock.c b/toys/other/hwclock.c index 5186a2d1..2f11cd4e 100644 --- a/toys/other/hwclock.c +++ b/toys/other/hwclock.c @@ -41,7 +41,11 @@ GLOBALS( // Bug workaround for musl commit 2c2c3605d3b3 which rewrote the syscall // wrapper to not use the syscall, which is the only way to set kernel's sys_tz +#ifdef _NR_settimeofday #define settimeofday(x, tz) syscall(__NR_settimeofday, (void *)0, (void *)tz) +#else +#define settimeofday(x, tz) ((tz)->tz_minuteswest = 0) +#endif void hwclock_main() { -- 2.39.2