From patchwork Wed Apr 18 20:17:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Albert ARIBAUD X-Patchwork-Id: 26793 Received: (qmail 104575 invoked by alias); 18 Apr 2018 20:19:37 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 104320 invoked by uid 89); 18 Apr 2018 20:19:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW, RCVD_IN_RP_RNBL autolearn=ham version=3.3.2 spammy= X-HELO: smtp3-g21.free.fr From: "Albert ARIBAUD (3ADEV)" To: libc-alpha@sourceware.org Cc: "Albert ARIBAUD (3ADEV)" Subject: [[PATCH RFC 2] 14/63] Y2038: arm: implement clock_gettime64 as a VDSO symbol Date: Wed, 18 Apr 2018 22:17:30 +0200 Message-Id: <20180418201819.15952-15-albert.aribaud@3adev.fr> In-Reply-To: <20180418201819.15952-14-albert.aribaud@3adev.fr> References: <20180418201819.15952-1-albert.aribaud@3adev.fr> <20180418201819.15952-2-albert.aribaud@3adev.fr> <20180418201819.15952-3-albert.aribaud@3adev.fr> <20180418201819.15952-4-albert.aribaud@3adev.fr> <20180418201819.15952-5-albert.aribaud@3adev.fr> <20180418201819.15952-6-albert.aribaud@3adev.fr> <20180418201819.15952-7-albert.aribaud@3adev.fr> <20180418201819.15952-8-albert.aribaud@3adev.fr> <20180418201819.15952-9-albert.aribaud@3adev.fr> <20180418201819.15952-10-albert.aribaud@3adev.fr> <20180418201819.15952-11-albert.aribaud@3adev.fr> <20180418201819.15952-12-albert.aribaud@3adev.fr> <20180418201819.15952-13-albert.aribaud@3adev.fr> <20180418201819.15952-14-albert.aribaud@3adev.fr> --- sysdeps/unix/sysv/linux/arm/init-first.c | 15 +++++++++++++++ sysdeps/unix/sysv/linux/arm/libc-vdso.h | 1 + 2 files changed, 16 insertions(+) diff --git a/sysdeps/unix/sysv/linux/arm/init-first.c b/sysdeps/unix/sysv/linux/arm/init-first.c index f4293b1cf8..76528bf194 100644 --- a/sysdeps/unix/sysv/linux/arm/init-first.c +++ b/sysdeps/unix/sysv/linux/arm/init-first.c @@ -23,6 +23,14 @@ int (*VDSO_SYMBOL(gettimeofday)) (struct timeval *, void *) attribute_hidden; int (*VDSO_SYMBOL(clock_gettime)) (clockid_t, struct timespec *); +long (*VDSO_SYMBOL(clock_gettime64)) (clockid_t, struct __timespec64 *); + +int __y2038_linux_support; + +int __y2038_kernel_support (void) +{ + return __y2038_linux_support; +} static inline void _libc_vdso_platform_setup (void) @@ -36,6 +44,13 @@ _libc_vdso_platform_setup (void) p = _dl_vdso_vsym ("__vdso_clock_gettime", &linux26); PTR_MANGLE (p); VDSO_SYMBOL (clock_gettime) = p; + + /* (aaribaud) TODO: map to version where clock_gettime64 officially appears */ + p = _dl_vdso_vsym ("__vdso_clock_gettime64", NULL); + PTR_MANGLE (p); + VDSO_SYMBOL (clock_gettime64) = p; + + __y2038_linux_support = (p != NULL) ? 1 : 0; } # define VDSO_SETUP _libc_vdso_platform_setup diff --git a/sysdeps/unix/sysv/linux/arm/libc-vdso.h b/sysdeps/unix/sysv/linux/arm/libc-vdso.h index 52dd355818..dc616244c6 100644 --- a/sysdeps/unix/sysv/linux/arm/libc-vdso.h +++ b/sysdeps/unix/sysv/linux/arm/libc-vdso.h @@ -27,6 +27,7 @@ extern int (*VDSO_SYMBOL(gettimeofday)) (struct timeval *, void *) attribute_hidden; extern int (*VDSO_SYMBOL(clock_gettime)) (clockid_t, struct timespec *); +extern long (*VDSO_SYMBOL(clock_gettime64)) (clockid_t, struct __timespec64 *); #endif