summaryrefslogtreecommitdiff
path: root/libc/unistd/sysconf.c
diff options
context:
space:
mode:
authorPeter S. Mazinger <ps.m@gmx.net>2011-03-22 00:20:36 +0100
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2012-06-15 14:00:31 +0200
commitdf87a0f21e673bd4d79b174a39d8a72d5cac37ef (patch)
treeae0ee6cbe3c5bb923bcdf9038e4f658e7ed3a56d /libc/unistd/sysconf.c
parentf486c8ba614cefab645546568ccc541349e77f5b (diff)
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>
Diffstat (limited to 'libc/unistd/sysconf.c')
-rw-r--r--libc/unistd/sysconf.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/libc/unistd/sysconf.c b/libc/unistd/sysconf.c
index 66486ae9e..ce6016783 100644
--- a/libc/unistd/sysconf.c
+++ b/libc/unistd/sysconf.c
@@ -982,20 +982,9 @@ long int sysconf(int name)
#endif
case _SC_MONOTONIC_CLOCK:
-#ifdef __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 defined __UCLIBC_HAS_REALTIME__ && defined __NR_clock_getres
if (clock_getres(CLOCK_MONOTONIC, NULL) >= 0)
return _POSIX_VERSION;
-# endif
#endif
RETURN_NEG_1;