Browse Source

uClibc-ng: hotfix for frv

Waldemar Brodkorb 2 weeks ago
parent
commit
6f9cffbb8b

+ 39 - 0
toolchain/uclibc-ng/patches/1.0.58/0002-adjtimex-fix-for-architectures-lacking-__NR_clock_ad.patch

@@ -0,0 +1,39 @@
+From 2e7fff27755bcae26ded0ab2394cfbe13017fec4 Mon Sep 17 00:00:00 2001
+From: Waldemar Brodkorb <wbx@openadk.org>
+Date: Tue, 26 May 2026 21:23:42 +0200
+Subject: [PATCH] adjtimex: fix for architectures lacking __NR_clock_adjtime,
+ f.e. frv
+
+Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
+---
+ libc/sysdeps/linux/common/adjtimex.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/libc/sysdeps/linux/common/adjtimex.c b/libc/sysdeps/linux/common/adjtimex.c
+index 92c628296..af57a370a 100644
+--- a/libc/sysdeps/linux/common/adjtimex.c
++++ b/libc/sysdeps/linux/common/adjtimex.c
+@@ -6,12 +6,20 @@
+  * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+  */
+ 
++#include <sys/syscall.h>
+ #include <sys/timex.h>
+ #include <time.h>
+ 
+ int adjtimex(struct timex *buf)
+ {
++#ifdef __NR_clock_adjtime
+     return clock_adjtime(CLOCK_REALTIME, buf);
++#elif defined(__NR_adjtimex)
++    return syscall(__NR_adjtimex, buf);
++#else
++    errno = ENOSYS;
++    return -1;
++#endif
+ }
+ 
+ libc_hidden_def(adjtimex)
+-- 
+2.47.3
+