diff options
author | "Steven J. Hill" <sjhill@realitydiluted.com> | 2006-08-21 05:20:52 +0000 |
---|---|---|
committer | "Steven J. Hill" <sjhill@realitydiluted.com> | 2006-08-21 05:20:52 +0000 |
commit | 0f83aa066efc2023ccb7415e4f39486160124f2a (patch) | |
tree | e2aca4011f43bc3cc5a8d938bccaa80e4625da0c /libc/unistd/sysconf.c | |
parent | 11a333eb28a6f70fabfff69ccb4b07c0a6e4d75a (diff) | |
download | uClibc-alpine-0f83aa066efc2023ccb7415e4f39486160124f2a.tar.bz2 uClibc-alpine-0f83aa066efc2023ccb7415e4f39486160124f2a.tar.xz |
Merge from trunk.
Diffstat (limited to 'libc/unistd/sysconf.c')
-rw-r--r-- | libc/unistd/sysconf.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/libc/unistd/sysconf.c b/libc/unistd/sysconf.c index 0dde75102..430759889 100644 --- a/libc/unistd/sysconf.c +++ b/libc/unistd/sysconf.c @@ -1,3 +1,4 @@ +/* vi: set sw=4 ts=4: */ /* Copyright (C) 1991, 93, 95, 96, 97, 2000 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -32,6 +33,9 @@ #ifdef __UCLIBC_HAS_REGEX__ #include <regex.h> #endif +#ifdef __UCLIBC_HAS_THREADS_NATIVE__ +#include <sysdep.h> +#endif libc_hidden_proto(sysconf) @@ -81,6 +85,26 @@ long int sysconf(int name) __set_errno(EINVAL); return -1; +#ifdef __UCLIBC_HAS_THREADS_NATIVE__ +# ifdef __NR_clock_getres + case _SC_MONOTONIC_CLOCK: + /* Check using the clock_getres system call. */ + { + 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; + } +# endif + case _SC_THREAD_CPUTIME: +# ifdef _POSIX_THREAD_CPUTIME > 0 + return _POSIX_THREAD_CPUTIME; +# else + return -1; +# endif +#endif + case _SC_ARG_MAX: #ifdef ARG_MAX return ARG_MAX; |