From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 98876 invoked by alias); 5 Dec 2019 01:06:50 -0000 Mailing-List: contact glibc-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: , Sender: glibc-cvs-owner@sourceware.org List-Subscribe: Received: (qmail 98818 invoked by uid 10263); 5 Dec 2019 01:06:50 -0000 Date: Thu, 05 Dec 2019 01:06:00 -0000 Message-ID: <20191205010650.98817.qmail@sourceware.org> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Alistair Francis To: glibc-cvs@sourceware.org Subject: [glibc] sysdeps: Add clock_gettime64 vDSO X-Act-Checkin: glibc X-Git-Author: Alistair Francis X-Git-Refname: refs/heads/master X-Git-Oldrev: d0bc5b725dac852764b98b9b3e0560c003bd000a X-Git-Newrev: f6fbce7dd72145ed9272ac8ef3ea6123c390a72b X-SW-Source: 2019-q4/txt/msg00537.txt.bz2 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=f6fbce7dd72145ed9272ac8ef3ea6123c390a72b commit f6fbce7dd72145ed9272ac8ef3ea6123c390a72b Author: Alistair Francis Date: Wed Sep 18 08:37:58 2019 -0700 sysdeps: Add clock_gettime64 vDSO 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. Reviewed-by: Adhemerval Zanella Diff: --- 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 d90ca82..d005d13 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 792ac39..c6d505b 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;