Ver Fonte

sysconf.c: the clock_getres function is good for NPTL as well

Even if glibc reuses the syscall (bloat), we can reuse the function.
Make sure, that we use it only if it is provided by the syscall
and the function is really around (UCLIBC_HAS_REALTIME disables it),
else we get into a loop.

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Peter S. Mazinger há 14 anos atrás
pai
commit
df87a0f21e
1 ficheiros alterados com 1 adições e 12 exclusões
  1. 1 12
      libc/unistd/sysconf.c

+ 1 - 12
libc/unistd/sysconf.c

@@ -982,20 +982,9 @@ long int sysconf(int name)
 #endif
 #endif
 
 
     case _SC_MONOTONIC_CLOCK:
     case _SC_MONOTONIC_CLOCK:
-#ifdef __NR_clock_getres
+#if defined __UCLIBC_HAS_REALTIME__ && defined __NR_clock_getres
-    /* Check using the clock_getres system call.  */
-# ifdef __UCLIBC_HAS_THREADS_NATIVE__
-    {
-      struct timespec ts;
-      INTERNAL_SYSCALL_DECL (err);
-      int r;
-      r = INTERNAL_SYSCALL (clock_getres, err, 2, CLOCK_MONOTONIC, &ts);
-      return INTERNAL_SYSCALL_ERROR_P (r, err) ? -1 : _POSIX_VERSION;
-    }
-# elif defined __UCLIBC_HAS_REALTIME__
       if (clock_getres(CLOCK_MONOTONIC, NULL) >= 0)
       if (clock_getres(CLOCK_MONOTONIC, NULL) >= 0)
         return _POSIX_VERSION;
         return _POSIX_VERSION;
-# endif
 #endif
 #endif
       RETURN_NEG_1;
       RETURN_NEG_1;