]> git.ipfire.org Git - thirdparty/glibc.git/commit
linux: Assume clock_getres CLOCK_{PROCESS,THREAD}_CPUTIME_ID
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Wed, 16 Jan 2019 17:30:07 +0000 (17:30 +0000)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Fri, 22 Mar 2019 19:52:29 +0000 (16:52 -0300)
commit77b6f5534778b5403c87fa5415625aeb4c3cbf44
tree5d98bbb95c4e4aab0fa4be54911223726c1865d2
parent38cc11daa43b11b12a7774405accee1007de1adf
linux: Assume clock_getres CLOCK_{PROCESS,THREAD}_CPUTIME_ID

The Linux 3.2 clock_getres kernel code (kernel/posix-cpu-timers.c)
issued for clock_getres CLOCK_PROCESS_CPUTIME_ID (process_cpu_clock_getres)
and CLOCK_THREAD_CPUTIME_ID (thread_cpu_clock_getres) call
posix_cpu_clock_getres. And it fails on check_clock only if an invalid
clock is used (not the case) or if we pass an invalid the pid/tid in
29 msb of clock_id (not the case either).

This patch assumes that clock_getres syscall always support
CLOCK_PROCESS_CPUTIME_ID and CLOCK_THREAD_CPUTIME_ID, so there is no need
to fallback to hp-timing support for _SC_MONOTONIC_CLOCK neither to issue
the syscall to certify the clock_id is supported bt the kernel.  This
allows simplify the sysconf support to always use the syscall.

it also removes ia64 itc drift check and assume kernel handles it correctly.

Checked on aarch64-linux-gnu, x86_64-linux-gnu, and i686-linux-gnu.

* sysdeps/unix/sysv/linux/ia64/has_cpuclock.c: Remove file.
* sysdeps/unix/sysv/linux/ia64/sysconf.c: Likewise.
* sysdeps/unix/sysv/linux/sysconf.c (has_cpuclock): Remove function.
(__sysconf): Assume kernel support for _SC_MONOTONIC_CLOCK,
_SC_CPUTIME, and _SC_THREAD_CPUTIME.
ChangeLog
sysdeps/unix/sysv/linux/ia64/has_cpuclock.c [deleted file]
sysdeps/unix/sysv/linux/ia64/sysconf.c [deleted file]
sysdeps/unix/sysv/linux/sysconf.c