From patchwork Wed Apr 18 20:17:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Albert ARIBAUD X-Patchwork-Id: 26806 Received: (qmail 112381 invoked by alias); 18 Apr 2018 20:20:35 -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 112283 invoked by uid 89); 18 Apr 2018 20:20:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.8 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, KAM_NUMSUBJECT, RCVD_IN_DNSWL_LOW, RCVD_IN_RP_RNBL autolearn=ham version=3.3.2 spammy=Hx-languages-length:2367 X-HELO: smtp3-g21.free.fr From: "Albert ARIBAUD (3ADEV)" To: libc-alpha@sourceware.org Cc: "Albert ARIBAUD (3ADEV)" Subject: [[PATCH RFC 2] 27/63] Y2038: add function __timer_gettime64 Date: Wed, 18 Apr 2018 22:17:43 +0200 Message-Id: <20180418201819.15952-28-albert.aribaud@3adev.fr> In-Reply-To: <20180418201819.15952-27-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> <20180418201819.15952-15-albert.aribaud@3adev.fr> <20180418201819.15952-16-albert.aribaud@3adev.fr> <20180418201819.15952-17-albert.aribaud@3adev.fr> <20180418201819.15952-18-albert.aribaud@3adev.fr> <20180418201819.15952-19-albert.aribaud@3adev.fr> <20180418201819.15952-20-albert.aribaud@3adev.fr> <20180418201819.15952-21-albert.aribaud@3adev.fr> <20180418201819.15952-22-albert.aribaud@3adev.fr> <20180418201819.15952-23-albert.aribaud@3adev.fr> <20180418201819.15952-24-albert.aribaud@3adev.fr> <20180418201819.15952-25-albert.aribaud@3adev.fr> <20180418201819.15952-26-albert.aribaud@3adev.fr> <20180418201819.15952-27-albert.aribaud@3adev.fr> For Linux this uses the 32-bit time syscall, so it converts the syscall output into 64-bit time. --- rt/Versions | 3 +++ sysdeps/unix/sysv/linux/arm/librt.abilist | 2 ++ .../sysv/linux/powerpc/powerpc32/librt.abilist | 2 ++ sysdeps/unix/sysv/linux/timer_gettime.c | 22 ++++++++++++++++++++++ 4 files changed, 29 insertions(+) diff --git a/rt/Versions b/rt/Versions index 91e3fd2a20..8fcfba84fe 100644 --- a/rt/Versions +++ b/rt/Versions @@ -37,4 +37,7 @@ librt { GLIBC_2.7 { __mq_open_2; } + GLIBC_2.27 { + __timer_gettime64; + } } diff --git a/sysdeps/unix/sysv/linux/arm/librt.abilist b/sysdeps/unix/sysv/linux/arm/librt.abilist index b47aa0cc9c..f942d47058 100644 --- a/sysdeps/unix/sysv/linux/arm/librt.abilist +++ b/sysdeps/unix/sysv/linux/arm/librt.abilist @@ -1,3 +1,5 @@ +GLIBC_2.27 GLIBC_2.27 A +GLIBC_2.27 __timer_gettime64 F GLIBC_2.4 GLIBC_2.4 A GLIBC_2.4 aio_cancel F GLIBC_2.4 aio_cancel64 F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/librt.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/librt.abilist index 15e4418863..519a6f7657 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/librt.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/librt.abilist @@ -29,6 +29,8 @@ GLIBC_2.2 timer_delete F GLIBC_2.2 timer_getoverrun F GLIBC_2.2 timer_gettime F GLIBC_2.2 timer_settime F +GLIBC_2.27 GLIBC_2.27 A +GLIBC_2.27 __timer_gettime64 F GLIBC_2.3.4 GLIBC_2.3.4 A GLIBC_2.3.4 mq_close F GLIBC_2.3.4 mq_getattr F diff --git a/sysdeps/unix/sysv/linux/timer_gettime.c b/sysdeps/unix/sysv/linux/timer_gettime.c index 10a19d9ee7..94be3af4a2 100644 --- a/sysdeps/unix/sysv/linux/timer_gettime.c +++ b/sysdeps/unix/sysv/linux/timer_gettime.c @@ -39,3 +39,25 @@ timer_gettime (timer_t timerid, struct itimerspec *value) return res; } + +/* 64-bit time version */ + +int +__timer_gettime64 (timer_t timerid, struct __itimerspec64 *value) +{ + struct itimerspec value32; + struct timer *kt = (struct timer *) timerid; + int res; + + res = INLINE_SYSCALL (timer_gettime, 2, kt->ktimerid, &value32); + + if (res == 0) + { + value->it_value.tv_sec = value32.it_value.tv_sec; + value->it_value.tv_nsec = value32.it_value.tv_nsec; + value->it_interval.tv_sec = value32.it_interval.tv_sec; + value->it_interval.tv_nsec = value32.it_interval.tv_nsec; + } + + return res; +}