From patchwork Mon Jun 1 14:07:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Majewski X-Patchwork-Id: 39392 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 458A03870911; Mon, 1 Jun 2020 14:08:01 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.9]) by sourceware.org (Postfix) with ESMTPS id 694053851C17 for ; Mon, 1 Jun 2020 14:07:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 694053851C17 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: sourceware.org; spf=none smtp.mailfrom=lukma@denx.de Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 49bH7b1P1Pz1qsbQ; Mon, 1 Jun 2020 16:07:54 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 49bH7Z5Bpgz1qwwd; Mon, 1 Jun 2020 16:07:54 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id 6rWuOkSpSEX9; Mon, 1 Jun 2020 16:07:52 +0200 (CEST) X-Auth-Info: 9H+kTdc8k0+pxJzSkkH8DS/wQsg/sdRMLu8RAVhSbDA= Received: from localhost.localdomain (85-222-111-42.dynamic.chello.pl [85.222.111.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Mon, 1 Jun 2020 16:07:52 +0200 (CEST) From: Lukasz Majewski To: Joseph Myers , Paul Eggert , Adhemerval Zanella Subject: [RFC 00/12] [RFC] y2038: Convert timespec_{sub|add|create} in support to be Y2038 safe Date: Mon, 1 Jun 2020 16:07:28 +0200 Message-Id: <20200601140740.16371-1-lukma@denx.de> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Florian Weimer , GNU C Library , Andreas Schwab , Alistair Francis Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" This patch set is the first attempt to convert functions utilized by nptl and pthreads to support 64 bit time. First timespec* functions are renamed to have common "__" prefix for internal functions. This is a preparatory work for further conversion. One question with this patch set is how shall we tackle the conversion of time related functions (like e.g. ./support/timespec_add) used internally in glibc as helper functions for internal code or tests. I could follow the approach used for glibc syscalls (like clock_settime) to have two versions depending on __TIMESIZE and __WORDSIZE, but this seems to be an overkill for internally used functions. Patches with "Convert:" prefix replace struct timespec with struct __timespec64 in timespec_* functions. This is necessary to have in-glibc proper support for 64 bit time. The problem is with instant replacement of struct timespec with struct __timespec64 in glibc internal code (and tests). For replacing timesize with __timesize64 I could: - Replace its occurences in relevant directories - like ./nptl or ./sysdeps/pthreads - Replace them in functions (tests) and use explicit conversion functions - like valid_timespec_to_timespec64() - Replace _all_ occurences of struct timespec with struct __timespec64 at once with using sed on glibc tree. The last option seems to be the most appealing as we already use __timespec64 (with its aliassing) for some core system syscalls (like clock_gettime). However, such patch shall be applied just after the release of new stable version to have time for potential fixes. Lukasz Majewski (12): doc: Fix wording and formattine in ./support/README y2038: Rename timespec_compare to __timespec_compare y2038: Rename make_timespec to __make_timespec y2038: Rename xclock_gettime to __xclock_gettime y2038: Rename xclock_now to __xclock_now y2038: Rename timespec_sub to __timespec_sub y2038: Rename timespec_add to __timespec_add y2038: Convert __make_timespec to be Y2038 safe y2038: Convert __xclock_gettime to be Y2038 safe y2038: Convert __xclock_now to be Y2038 safe y2038: Convert timespec* files in ./support to be Y2038 safe y2038: Convert timespec_* from posix-timer.h to be Y2038 safe nptl/tst-eintr2.c | 4 ++-- nptl/tst-eintr5.c | 4 ++-- nptl/tst-rwlock6.c | 14 +++++++------- nptl/tst-rwlock7.c | 10 +++++----- nptl/tst-rwlock9.c | 10 +++++----- nptl/tst-sem17.c | 2 +- nptl/tst-sem5.c | 4 ++-- support/README | 4 ++-- support/timespec-add.c | 12 ++++++------ support/timespec-sub.c | 18 +++++++++--------- support/timespec.c | 12 ++++++------ support/timespec.h | 27 ++++++++++++++------------- support/xclock_gettime.c | 5 ++--- support/xtime.h | 9 +++++---- sysdeps/mach/clock_nanosleep.c | 4 ++-- sysdeps/pthread/posix-timer.h | 11 ++++++----- sysdeps/pthread/timer_gettime.c | 4 ++-- sysdeps/pthread/timer_routines.c | 14 +++++++------- sysdeps/pthread/timer_settime.c | 4 ++-- sysdeps/pthread/tst-cond11.c | 2 +- sysdeps/pthread/tst-cond26.c | 2 +- sysdeps/pthread/tst-cond27.c | 4 ++-- sysdeps/pthread/tst-join14.c | 2 +- sysdeps/pthread/tst-join3.c | 8 ++++---- sysdeps/pthread/tst-join5.c | 12 ++++++------ sysdeps/pthread/tst-mutex5.c | 12 ++++++------ sysdeps/pthread/tst-mutex9.c | 4 ++-- sysdeps/pthread/tst-rwlock14.c | 2 +- 28 files changed, 111 insertions(+), 109 deletions(-)