diff options
author | Ulrich Drepper <drepper@redhat.com> | 2001-04-24 05:18:27 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2001-04-24 05:18:27 +0000 |
commit | 295125c54256c6df5599aa23029cb3eb6e2f2e33 (patch) | |
tree | 5a072a6caad89c9905346aeb69672b13ac575d36 /sysdeps/generic | |
parent | 7e9463020bc7ef69f66eb4bb27c1a1e065cdc90c (diff) | |
download | glibc-295125c54256c6df5599aa23029cb3eb6e2f2e33.zip glibc-295125c54256c6df5599aa23029cb3eb6e2f2e33.tar.gz glibc-295125c54256c6df5599aa23029cb3eb6e2f2e33.tar.bz2 |
Update.
* sysdeps/ia64/Makefile [subdir=csu] (sysdep_routines): Add hp-timing.
* sysdeps/ia64/Versions: Add _dl_cpuclock_offset for ld in 2.2.3.
* sysdeps/ia64/hp-timing.c: New file.
* sysdeps/ia64/hp-timing.h: New file.
* sysdeps/unix/sysv/linux/ia64/bits/time.h: Add definitions for
CLOCK_PROCESS_CPUTIME_ID and CLOCK_THREAD_CPUTIME_ID.
* sysdeps/generic/clock_getcpuclockid.c: Make function generic, test
using #ifdef whether the clock is available.
* sysdeps/unix/i386/clock_getcpuclockid.c: Not needed anymore.
* sysdeps/generic/dl-sysdep.c: Initialize _dl_cpuclock_offset to move
it into data section.
Diffstat (limited to 'sysdeps/generic')
-rw-r--r-- | sysdeps/generic/clock_getcpuclockid.c | 11 | ||||
-rw-r--r-- | sysdeps/generic/dl-sysdep.c | 2 |
2 files changed, 12 insertions, 1 deletions
diff --git a/sysdeps/generic/clock_getcpuclockid.c b/sysdeps/generic/clock_getcpuclockid.c index 07f6c22..f39a8cf 100644 --- a/sysdeps/generic/clock_getcpuclockid.c +++ b/sysdeps/generic/clock_getcpuclockid.c @@ -22,6 +22,17 @@ int clock_getcpuclockid (pid_t pid, clockid_t *clock_id) { + /* We don't allow any process ID but our own. */ + if (pid != 0 && pid != getpid ()) + return EPERM; + +#ifdef CLOCK_PROCESS_CPUTIME_ID + /* Store the number. */ + *clock_id = CLOCK_PROCESS_CPUTIME_ID; + + return 0; +#else /* We don't have a timer for that. */ return ENOENT; +#endif } diff --git a/sysdeps/generic/dl-sysdep.c b/sysdeps/generic/dl-sysdep.c index 114ec8b..1880084 100644 --- a/sysdeps/generic/dl-sysdep.c +++ b/sysdeps/generic/dl-sysdep.c @@ -62,7 +62,7 @@ void *__libc_stack_end; static ElfW(auxv_t) *_dl_auxv; unsigned long int _dl_hwcap_mask = HWCAP_IMPORTANT; #if HP_TIMING_AVAIL -hp_timing_t _dl_cpuclock_offset; +hp_timing_t _dl_cpuclock_offset = 0; #endif #ifndef DL_FIND_ARG_COMPONENTS |