From patchwork Fri Dec 4 23:36:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Majewski X-Patchwork-Id: 41317 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 13ED13982402; Fri, 4 Dec 2020 23:37:14 +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 EF084397A03E for ; Fri, 4 Dec 2020 23:37:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org EF084397A03E 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 4Cnpyb05z2z1qs3d; Sat, 5 Dec 2020 00:37:11 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4CnpyZ5rXSz1qqkk; Sat, 5 Dec 2020 00:37:10 +0100 (CET) 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 hPA2hzRSfUMc; Sat, 5 Dec 2020 00:37:09 +0100 (CET) X-Auth-Info: Fu2hzffaUZtotRC9rMOolzY6/VaoUGKsuXTkjW8div8= Received: from localhost.localdomain (89-64-5-98.dynamic.chello.pl [89.64.5.98]) (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; Sat, 5 Dec 2020 00:37:09 +0100 (CET) From: Lukasz Majewski To: Joseph Myers , Paul Eggert , Adhemerval Zanella Subject: [RFC 2/6] y2038: stat: {f}stat{at}64_time64 redirection to be used on Y2038 systems Date: Sat, 5 Dec 2020 00:36:00 +0100 Message-Id: <20201204233604.7430-3-lukma@denx.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201204233604.7430-1-lukma@denx.de> References: <20201204233604.7430-1-lukma@denx.de> MIME-Version: 1.0 X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, 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=ham 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 , Siddhesh Poyarekar , Andreas Schwab , Stepan Golosunov , Alistair Francis Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" --- io/Versions | 4 +++ io/sys/stat.h | 80 +++++++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 76 insertions(+), 8 deletions(-) diff --git a/io/Versions b/io/Versions index 15616b68f3..ce34180e30 100644 --- a/io/Versions +++ b/io/Versions @@ -148,5 +148,9 @@ libc { __fstat64; __ppoll64; __utime64; + __stat64_time64; + __fstat64_time64; + __lstat64_time64; + __fstatat64_time64; } } diff --git a/io/sys/stat.h b/io/sys/stat.h index b3f2f0da99..b89b7b1b7d 100644 --- a/io/sys/stat.h +++ b/io/sys/stat.h @@ -210,20 +210,45 @@ extern int stat (const char *__restrict __file, extern int fstat (int __fd, struct stat *__buf) __THROW __nonnull ((2)); #else # ifdef __REDIRECT_NTH +# ifdef __USE_TIME_BITS64 +extern int __REDIRECT_NTH (stat, (const char *__restrict __file, + struct stat *__restrict __buf), + __stat64_time64) __nonnull ((1, 2)); +extern int __REDIRECT_NTH (fstat, (int __fd, struct stat *__buf), + __fstat64_time64) __nonnull ((2)); +# else extern int __REDIRECT_NTH (stat, (const char *__restrict __file, struct stat *__restrict __buf), stat64) __nonnull ((1, 2)); extern int __REDIRECT_NTH (fstat, (int __fd, struct stat *__buf), fstat64) __nonnull ((2)); +# endif # else -# define stat stat64 -# define fstat fstat64 +# ifdef __USE_TIME_BITS64 +# define stat __stat64_time64 +# define fstat __fstat64_time64 +# else +# define stat stat64 +# define fstat fstat64 +# endif # endif #endif #ifdef __USE_LARGEFILE64 extern int stat64 (const char *__restrict __file, struct stat64 *__restrict __buf) __THROW __nonnull ((1, 2)); extern int fstat64 (int __fd, struct stat64 *__buf) __THROW __nonnull ((2)); +# ifdef __USE_TIME_BITS64 +# if defined(__REDIRECT_NTH) +extern int __REDIRECT_NTH (stat64, (const char *__restrict __file, + struct stat64 *__restrict __buf), + __stat64_time64) __nonnull ((1, 2)); +extern int __REDIRECT_NTH (fstat64, (int __fd, struct stat64 *__buf), + __fstat64_time64) __nonnull ((2)); +# else +# define stat64 __stat64_time64 +# define fstat64 __fstat64_time64 +# endif +# endif #endif #ifdef __USE_ATFILE @@ -236,19 +261,39 @@ extern int fstatat (int __fd, const char *__restrict __file, __THROW __nonnull ((2, 3)); # else # ifdef __REDIRECT_NTH +# ifdef __USE_TIME_BITS64 +extern int __REDIRECT_NTH (fstatat, (int __fd, const char *__restrict __file, + struct stat *__restrict __buf, int __flag), + __fstatat64_time64) __nonnull ((2, 3)); +# else extern int __REDIRECT_NTH (fstatat, (int __fd, const char *__restrict __file, struct stat *__restrict __buf, int __flag), fstatat64) __nonnull ((2, 3)); +# endif /* __USE_TIME_BITS64 */ # else -# define fstatat fstatat64 +# ifdef __USE_TIME_BITS64 +# define fstatat __fstatat64_time64 +# else +# define fstatat fstatat64 +# endif # endif -# endif +# endif /* __USE_FILE_OFFSET64 */ # ifdef __USE_LARGEFILE64 extern int fstatat64 (int __fd, const char *__restrict __file, struct stat64 *__restrict __buf, int __flag) __THROW __nonnull ((2, 3)); +# ifdef __USE_TIME_BITS64 +# if defined(__REDIRECT_NTH) +extern int __REDIRECT_NTH (fstatat64, + (int __fd, const char *__restrict __file, + struct stat64 *__restrict __buf, int __flag), + __fstatat64_time64) __nonnull ((2, 3)); +# else +# define fstatat64 __fstatat64_time64 +# endif +# endif /* __USE_TIME_BITS64 */ # endif #endif @@ -260,19 +305,38 @@ extern int lstat (const char *__restrict __file, struct stat *__restrict __buf) __THROW __nonnull ((1, 2)); # else # ifdef __REDIRECT_NTH +# ifdef __USE_TIME_BITS64 +extern int __REDIRECT_NTH (lstat, (const char *__restrict __file, + struct stat *__restrict __buf), + __lstat64_time64) __nonnull ((1, 2)); +# else extern int __REDIRECT_NTH (lstat, (const char *__restrict __file, struct stat *__restrict __buf), lstat64) __nonnull ((1, 2)); +# endif /* __USE_TIME_BITS64 */ # else -# define lstat lstat64 -# endif -# endif +# ifdef __USE_TIME_BITS64 +# define lstat __lstat64_time64 +# else +# define lstat lstat64 +# endif +# endif /* __REDIRECT_NTH */ +# endif /* __USE_FILE_OFFSET64 */ # ifdef __USE_LARGEFILE64 extern int lstat64 (const char *__restrict __file, struct stat64 *__restrict __buf) __THROW __nonnull ((1, 2)); -# endif +# ifdef __USE_TIME_BITS64 +# if defined(__REDIRECT_NTH) +extern int __REDIRECT_NTH (lstat64, (const char *__restrict __file, + struct stat64 *__restrict __buf), + __lstat64_time64) __nonnull ((1, 2)); +# else +# define lstat64 __lstat64_time64 +# endif +# endif /* __USE_TIME_BITS64 */ +# endif /* __USE_LARGEFILE64 */ #endif /* Set file access permissions for FILE to MODE.