aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/posix
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-06-25 00:00:50 +0000
committerUlrich Drepper <drepper@redhat.com>2003-06-25 00:00:50 +0000
commit4165d44d7026bb2572d4cdfe27f8fec348b4089a (patch)
tree911aa068d7d9c4205ad6a4965ce156c937fed219 /sysdeps/posix
parent51d1ca00fd1ddc2ed77b615b7a23ecdf3e8a55a9 (diff)
downloadglibc-4165d44d7026bb2572d4cdfe27f8fec348b4089a.tar
glibc-4165d44d7026bb2572d4cdfe27f8fec348b4089a.tar.gz
glibc-4165d44d7026bb2572d4cdfe27f8fec348b4089a.tar.bz2
glibc-4165d44d7026bb2572d4cdfe27f8fec348b4089a.zip
Update.
* include/time.h: Define CLOCK_IDFIELD_SIZE. * sysdeps/posix/clock_getres.c: Recognize thread CPU clock IDs. * sysdeps/unix/clock_gettime.c: Likewise. * sysdeps/unix/clock_settime.c: Likewise. * sysdeps/unix/clock_nanosleep.c (CPUCLOCK_P): Adjust for new clock id for thread CPU clocks.
Diffstat (limited to 'sysdeps/posix')
-rw-r--r--sysdeps/posix/clock_getres.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/sysdeps/posix/clock_getres.c b/sysdeps/posix/clock_getres.c
index 91c57629ca..a2d466607e 100644
--- a/sysdeps/posix/clock_getres.c
+++ b/sysdeps/posix/clock_getres.c
@@ -64,9 +64,19 @@ clock_getres (clockid_t clock_id, struct timespec *res)
break;
#endif /* handled REALTIME */
+ default:
+#if HP_TIMING_AVAIL
+ if ((clock_id & ((1 << CLOCK_IDFIELD_SIZE) - 1))
+ != CLOCK_THREAD_CPUTIME_ID)
+#endif
+ {
+ __set_errno (EINVAL);
+ break;
+ }
+
#if HP_TIMING_AVAIL && !defined HANDLED_CPUTIME
+ /* FALLTHROUGH. */
case CLOCK_PROCESS_CPUTIME_ID:
- case CLOCK_THREAD_CPUTIME_ID:
{
if (__builtin_expect (nsec == 0, 0))
{
@@ -93,10 +103,6 @@ clock_getres (clockid_t clock_id, struct timespec *res)
}
break;
#endif
-
- default:
- __set_errno (EINVAL);
- break;
}
return retval;