1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00
* 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.
This commit is contained in:
Ulrich Drepper
2003-06-25 00:00:50 +00:00
parent 51d1ca00fd
commit 4165d44d70
14 changed files with 355 additions and 36 deletions

View File

@ -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;