mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
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.
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2000 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 2000, 2001 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
@ -19,10 +19,22 @@
|
||||
#include <errno.h>
|
||||
#include <pthread.h>
|
||||
#include <sys/time.h>
|
||||
#include <internals.h>
|
||||
|
||||
int
|
||||
pthread_getcpuclockid (pthread_t pthread_id, clockid_t *clock_id)
|
||||
pthread_getcpuclockid (pthread_t thread_id, clockid_t *clock_id)
|
||||
{
|
||||
/* We don't allow any process ID but our own. */
|
||||
if (thread_handle (thread_id)->h_descr != thread_self ())
|
||||
return EPERM;
|
||||
|
||||
#ifdef CLOCK_THREAD_CPUTIME_ID
|
||||
/* Store the number. */
|
||||
*clock_id = CLOCK_THREAD_CPUTIME_ID;
|
||||
|
||||
return 0;
|
||||
#else
|
||||
/* We don't have a timer for that. */
|
||||
return ENOENT;
|
||||
#endif
|
||||
}
|
||||
|
Reference in New Issue
Block a user