This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [RFC v3 13/23] RISC-V: Use 64-bit timespec in clock_gettime vdso calls
- From: Arnd Bergmann <arnd at arndb dot de>
- To: Alistair Francis <alistair dot francis at wdc dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>, Adhemerval Zanella <adhemerval dot zanella at linaro dot org>, Florian Weimer <fweimer at redhat dot com>, Palmer Dabbelt <palmer at sifive dot com>, macro at wdc dot com, Zong Li <zongbox at gmail dot com>, Alistair Francis <alistair23 at gmail dot com>
- Date: Wed, 17 Jul 2019 10:13:45 +0200
- Subject: Re: [RFC v3 13/23] RISC-V: Use 64-bit timespec in clock_gettime vdso calls
- References: <cover.1563321715.git.alistair.francis@wdc.com> <e6aea1c15190c5555e859775dac70c5ef8eab12c.1563321715.git.alistair.francis@wdc.com>
On Wed, Jul 17, 2019 at 2:12 AM Alistair Francis
<alistair.francis@wdc.com> wrote:
>
> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> ---
> sysdeps/unix/sysv/linux/riscv/init-first.c | 2 +-
> sysdeps/unix/sysv/linux/riscv/libc-vdso.h | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/sysdeps/unix/sysv/linux/riscv/init-first.c b/sysdeps/unix/sysv/linux/riscv/init-first.c
> index 8134c79695..155a4a2c0c 100644
> --- a/sysdeps/unix/sysv/linux/riscv/init-first.c
> +++ b/sysdeps/unix/sysv/linux/riscv/init-first.c
> @@ -25,7 +25,7 @@ long int (*VDSO_SYMBOL (getcpu)) (unsigned int *, unsigned int *, void *)
> attribute_hidden;
> long int (*VDSO_SYMBOL (gettimeofday)) (struct timeval *, void *)
> attribute_hidden;
> -long int (*VDSO_SYMBOL (clock_gettime)) (clockid_t, struct timespec *)
> +long int (*VDSO_SYMBOL (clock_gettime)) (clockid_t, struct __timespec64 *)
The vdso symbol in the kernel should be __clock_gettime64().
The gettimeofday() and clock_getres() functions should not have a
vdso symbol on 32-bit but instead get implemented by claling __clock_gettime64()
or the clock_getres() syscall.
If someone has a good reason for introducing a clock_getres_time64() vdso
symbol, we can do that as well, but so far I am not aware of any performance
critical caller of clock_getres().
Arnd