From patchwork Thu Sep 7 22:41:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Albert ARIBAUD X-Patchwork-Id: 22727 Received: (qmail 77269 invoked by alias); 7 Sep 2017 22:43:49 -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 77187 invoked by uid 89); 7 Sep 2017 22:43:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.6 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 autolearn=ham version=3.3.2 spammy= X-HELO: smtp6-g21.free.fr From: "Albert ARIBAUD (3ADEV)" To: libc-alpha@sourceware.org Cc: "Albert ARIBAUD (3ADEV)" Subject: [RFC PATCH 19/52] Y2038: add function __timer_gettime64 Date: Fri, 8 Sep 2017 00:41:46 +0200 Message-Id: <20170907224219.12483-20-albert.aribaud@3adev.fr> In-Reply-To: <20170907224219.12483-19-albert.aribaud@3adev.fr> References: <20170907224219.12483-1-albert.aribaud@3adev.fr> <20170907224219.12483-2-albert.aribaud@3adev.fr> <20170907224219.12483-3-albert.aribaud@3adev.fr> <20170907224219.12483-4-albert.aribaud@3adev.fr> <20170907224219.12483-5-albert.aribaud@3adev.fr> <20170907224219.12483-6-albert.aribaud@3adev.fr> <20170907224219.12483-7-albert.aribaud@3adev.fr> <20170907224219.12483-8-albert.aribaud@3adev.fr> <20170907224219.12483-9-albert.aribaud@3adev.fr> <20170907224219.12483-10-albert.aribaud@3adev.fr> <20170907224219.12483-11-albert.aribaud@3adev.fr> <20170907224219.12483-12-albert.aribaud@3adev.fr> <20170907224219.12483-13-albert.aribaud@3adev.fr> <20170907224219.12483-14-albert.aribaud@3adev.fr> <20170907224219.12483-15-albert.aribaud@3adev.fr> <20170907224219.12483-16-albert.aribaud@3adev.fr> <20170907224219.12483-17-albert.aribaud@3adev.fr> <20170907224219.12483-18-albert.aribaud@3adev.fr> <20170907224219.12483-19-albert.aribaud@3adev.fr> Signed-off-by: Albert ARIBAUD (3ADEV) --- rt/Versions | 7 +++++++ sysdeps/unix/sysv/linux/timer_gettime.c | 24 ++++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/rt/Versions b/rt/Versions index 91e3fd2a20..f07c8e2b18 100644 --- a/rt/Versions +++ b/rt/Versions @@ -37,4 +37,11 @@ librt { GLIBC_2.7 { __mq_open_2; } + + # Y2038 symbols are given their own version until they can be put in + # the right place + + GLIBC_Y2038 { + __timer_gettime64; + } } diff --git a/sysdeps/unix/sysv/linux/timer_gettime.c b/sysdeps/unix/sysv/linux/timer_gettime.c index 849c56a30a..09aa6e5abf 100644 --- a/sysdeps/unix/sysv/linux/timer_gettime.c +++ b/sysdeps/unix/sysv/linux/timer_gettime.c @@ -39,3 +39,27 @@ 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; + + if (__y2038_kernel_support()) + return INLINE_SYSCALL (timer_gettime64, 2, kt->ktimerid, value); + + int 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; +}