This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH v2 1/2] sysdeps: Add clock_gettime64 vDSO
- From: Alistair Francis <alistair dot francis at wdc dot com>
- To: libc-alpha at sourceware dot org
- Cc: alistair23 at gmail dot com, Alistair Francis <alistair dot francis at wdc dot com>
- Date: Sat, 9 Nov 2019 18:56:57 -0800
- Subject: [PATCH v2 1/2] sysdeps: Add clock_gettime64 vDSO
- Ironport-sdr: troff2zG040W7IiPeTh1qCKpf4hcNEInuhMFDkC+P1wlHoNG1Mj/Cm4FigDR6CcFXvTLpzHT7F RUI2slOK6rCNisWh6WM/es2reFG+jx3rqZgkHpP8dfsqYkoc9M8ZlF/aOSsCTirLL/I4OJTleV GJ204T7plqp69bCbOA2V7TtGM1BVsRFmRVML9xOvytlTwrvnljtrLX4AGfhB3RK8sPEDcSuLAg Rwg5Rq4ioLA8SurNhwhrFfGHAi3t23UePaVQ/LM6WCs4tSF5OVJG1199WTUWWUFnBxNV0XmmAP Fr0=
- Ironport-sdr: cc635yjyjw7pk4vC5maa2pyFeg6m8HtDDP11OTIrQWw1HRgYYi1FKQrhkRg6xw0YEOiCi4PUyT VGBg6g0R3UUyBQCpjzsIjQ/lV4nLAxK3z8DX4ABMu2c9TIfz3prtdRVQhnp2jQVzU2e93FLOno 2YPlzAs5l8y/9EMzrrr2zyDey71sGG97c/OH/dx7q12rZ/xWexuMXVCPx5BycR5DDZlx3DDMUF HkjCIZTg2+IW6yG2W8oReGb5cdVwpPryDTCL5gOFjoqJXqvu+ICSVbce1odt4BJl7SOmqZnssk CWSDndCr9a/2V6N3H1p2tO4d
- Ironport-sdr: gHBLBtGzs/CYVm1O0nY49DkcG4dkyNUsstUoWSRdmZybPVhHHrAyvcNpgCwfw8FfOxbOkYXryU Ia+Ypmz/fNuvRBMKG0O4+7W/1OZTP58nWHqduCqvyWs4CxAkgN1Hdc8uKUkhv3EWSFny6N7Lni VAu5MjkQYmg5F9EBe+eYmwFkUy/a5up1sGVd8K+M14bUIWrvwP6uq4oghcSfuctAFXes+Fk+yO J9wBORKE2YNcgBSUup6/LUk3p1xyVJseSGl2SdZssnvE7BjFckZJXhjsRIwA6GQiQo+5BtkmYj yH4=
- Wdcironportexception: Internal
Add support for the clock_gettim64 vDSO calls. These are protected by
the HAVE_CLOCK_GETTIME64_VSYSCALL define.
HAVE_CLOCK_GETTIME64_VSYSCALL should be defined for 32-bit platforms
(WORDSIZE == 32) that only run on the 5.1 kernel or later. WORDSIZE ==
64 platforms can use #define __vdso_clock_gettime64 __vdso_clock_gettime
and use the __vdso_clock_gettime syscall as they don't have a
__vdso_clock_gettime64 call.
* sysdeps/unix/sysv/linux/init-first.c: Add clock_gettime64
vDSO.
* sysdeps/unix/sysv/linux/libc-vdso.h: Likewise.
---
sysdeps/unix/sysv/linux/init-first.c | 10 ++++++++++
sysdeps/unix/sysv/linux/libc-vdso.h | 4 ++++
2 files changed, 14 insertions(+)
diff --git a/sysdeps/unix/sysv/linux/init-first.c b/sysdeps/unix/sysv/linux/init-first.c
index d90ca820be0..d005d133220 100644
--- a/sysdeps/unix/sysv/linux/init-first.c
+++ b/sysdeps/unix/sysv/linux/init-first.c
@@ -24,6 +24,11 @@
int (*VDSO_SYMBOL(clock_gettime)) (clockid_t, struct timespec *)
attribute_hidden;
#endif
+/* vDSO symbol used on clock_gettime64 implementation. */
+#ifdef HAVE_CLOCK_GETTIME64_VSYSCALL
+int (*VDSO_SYMBOL(clock_gettime64)) (clockid_t, struct __timespec64 *)
+ attribute_hidden;
+#endif
/* vDSO symbol used on clock_getres implementation. */
#ifdef HAVE_CLOCK_GETRES_VSYSCALL
int (*VDSO_SYMBOL(clock_getres)) (clockid_t, struct timespec *)
@@ -52,6 +57,11 @@ __libc_vdso_platform_setup (void)
= get_vdso_mangle_symbol (HAVE_CLOCK_GETTIME_VSYSCALL);
#endif
+#ifdef HAVE_CLOCK_GETTIME64_VSYSCALL
+ VDSO_SYMBOL(clock_gettime64)
+ = get_vdso_mangle_symbol (HAVE_CLOCK_GETTIME64_VSYSCALL);
+#endif
+
#ifdef HAVE_CLOCK_GETRES_VSYSCALL
VDSO_SYMBOL(clock_getres)
= get_vdso_mangle_symbol (HAVE_CLOCK_GETRES_VSYSCALL);
diff --git a/sysdeps/unix/sysv/linux/libc-vdso.h b/sysdeps/unix/sysv/linux/libc-vdso.h
index 792ac39d85a..c6d505bab39 100644
--- a/sysdeps/unix/sysv/linux/libc-vdso.h
+++ b/sysdeps/unix/sysv/linux/libc-vdso.h
@@ -32,6 +32,10 @@
extern int (*VDSO_SYMBOL(clock_gettime)) (clockid_t, struct timespec *)
attribute_hidden;
#endif
+#ifdef HAVE_CLOCK_GETTIME64_VSYSCALL
+extern int (*VDSO_SYMBOL(clock_gettime64)) (clockid_t, struct __timespec64 *)
+ attribute_hidden;
+#endif
#ifdef HAVE_CLOCK_GETRES_VSYSCALL
extern int (*VDSO_SYMBOL(clock_getres)) (clockid_t, struct timespec *)
attribute_hidden;
--
2.23.0