summaryrefslogtreecommitdiff
path: root/libc/unistd
diff options
context:
space:
mode:
authorAustin Foxley <austinf@cetoncorp.com>2009-10-17 14:42:01 -0700
committerAustin Foxley <austinf@cetoncorp.com>2009-10-17 14:42:01 -0700
commita202cf6f119f41532b60ad28bc48746b535fd34c (patch)
tree03e96b87732058543d681803a829ee02238e5ab9 /libc/unistd
parent93e6d12ea06dc489cde0d96f78d623410703d33e (diff)
librt additions that are now possible with nptl
* clock_getcpuclockid, clock_gettime, clock_nanosleep, mq_receive, mq_send, mq_timedreceive, mq_timedsend, _SC_MONOTONIC_CLOCK Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
Diffstat (limited to 'libc/unistd')
-rw-r--r--libc/unistd/sysconf.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/libc/unistd/sysconf.c b/libc/unistd/sysconf.c
index 87206648e..b3eb12021 100644
--- a/libc/unistd/sysconf.c
+++ b/libc/unistd/sysconf.c
@@ -33,6 +33,9 @@
#ifdef __UCLIBC_HAS_REGEX__
#include <regex.h>
#endif
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+#include <sysdep.h>
+#endif
#ifdef HAVE_LINUX_CPUMASK_H
# include <linux/cpumask.h>
@@ -881,13 +884,32 @@ long int sysconf(int name)
#endif
case _SC_MONOTONIC_CLOCK:
-#if defined __UCLIBC_HAS_REALTIME__ && defined __NR_clock_getres
- /* Check using the clock_getres system call. */
+#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;
+ }
+# else
if (clock_getres(CLOCK_MONOTONIC, NULL) >= 0)
return _POSIX_VERSION;
+
+ RETURN_NEG_1;
+# endif
#endif
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+ case _SC_THREAD_CPUTIME:
+# if _POSIX_THREAD_CPUTIME > 0
+ return _POSIX_THREAD_CPUTIME;
+# else
RETURN_NEG_1;
+# endif
+#endif
}
}
libc_hidden_def(sysconf)