From c738465a4c13370f58b797a82cdf1c67e1121867 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sat, 28 May 2011 01:53:26 -0400 Subject: Add support for time syscall in vDSO --- sysdeps/unix/sysv/linux/x86_64/init-first.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'sysdeps/unix/sysv/linux/x86_64/init-first.c') diff --git a/sysdeps/unix/sysv/linux/x86_64/init-first.c b/sysdeps/unix/sysv/linux/x86_64/init-first.c index 23934fc857..e676f623e1 100644 --- a/sysdeps/unix/sysv/linux/x86_64/init-first.c +++ b/sysdeps/unix/sysv/linux/x86_64/init-first.c @@ -28,6 +28,8 @@ strong_alias (__vdso_clock_gettime, __GI___vdso_clock_gettime attribute_hidden) long int (*__vdso_getcpu) (unsigned *, unsigned *, void *); +long int (*__vdso_time) (time_t *) attribute_hidden; + static inline void _libc_vdso_platform_setup (void) @@ -53,6 +55,14 @@ _libc_vdso_platform_setup (void) p = (void *) VSYSCALL_ADDR_vgetcpu; PTR_MANGLE (p); __vdso_getcpu = p; + + p = _dl_vdso_vsym ("time", &linux26); + /* If the vDSO is not available we fall back on the old vsyscall. */ +#define VSYSCALL_ADDR_vtime 0xffffffffff600400 + if (p == NULL) + p = (void *) VSYSCALL_ADDR_vtime; + PTR_MANGLE (p); + __vdso_time = p; } # define VDSO_SETUP _libc_vdso_platform_setup -- cgit v1.2.1