Przeglądaj źródła

adjtimex: fix for architectures lacking __NR_clock_adjtime, f.e. frv

Waldemar Brodkorb 2 tygodni temu
rodzic
commit
2e7fff2775
1 zmienionych plików z 8 dodań i 0 usunięć
  1. 8 0
      libc/sysdeps/linux/common/adjtimex.c

+ 8 - 0
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)