From patchwork Sat Jan 18 07:20:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Majewski X-Patchwork-Id: 37432 Received: (qmail 59117 invoked by alias); 18 Jan 2020 07:21:21 -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 59034 invoked by uid 89); 18 Jan 2020 07:21:21 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 spammy= X-HELO: mail-out.m-online.net From: Lukasz Majewski To: Joseph Myers , Paul Eggert , Adhemerval Zanella , Samuel Thibault Cc: Alistair Francis , Alistair Francis , GNU C Library , Siddhesh Poyarekar , Florian Weimer , Florian Weimer , Zack Weinberg , Carlos O'Donell , Andreas Schwab , Lukasz Majewski Subject: [PATCH 1/6] y2038: Use __clock_settime64 in deprecated stime function Date: Sat, 18 Jan 2020 08:20:42 +0100 Message-Id: <20200118072047.23071-2-lukma@denx.de> In-Reply-To: <20200118072047.23071-1-lukma@denx.de> References: <20200118072047.23071-1-lukma@denx.de> MIME-Version: 1.0 Now, internally the deprecated stime uses __clock_settime64. This patch is necessary for having architectures with __WORDSIZE == 32 && __TIMESIZE == 32 (like e.g. ARM32) Y2038 safe. Build tests: ./src/scripts/build-many-glibcs.py glibcs --- time/stime.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/time/stime.c b/time/stime.c index 576fa9c0c9..963902126b 100644 --- a/time/stime.c +++ b/time/stime.c @@ -27,11 +27,11 @@ int attribute_compat_text_section __stime (const time_t *when) { - struct timespec ts; + struct __timespec64 ts; ts.tv_sec = *when; ts.tv_nsec = 0; - return __clock_settime (CLOCK_REALTIME, &ts); + return __clock_settime64 (CLOCK_REALTIME, &ts); } compat_symbol (libc, __stime, stime, GLIBC_2_0);