From patchwork Tue Oct 13 13:16:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Majewski X-Patchwork-Id: 40712 X-Patchwork-Delegate: l.majewski@majess.pl 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 44E0F388EC0A; Tue, 13 Oct 2020 13:16:56 +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 E6E543857838 for ; Tue, 13 Oct 2020 13:16:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E6E543857838 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 4C9bfq2hFdz1qs38; Tue, 13 Oct 2020 15:16:51 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4C9bfq1QVMz1qqkC; Tue, 13 Oct 2020 15:16:51 +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 DfFoMG8AexfW; Tue, 13 Oct 2020 15:16:49 +0200 (CEST) X-Auth-Info: peYbKkn2MuADHhUvSKRmyCvbtkpFHsgOTtmz0PPBcE0= 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; Tue, 13 Oct 2020 15:16:49 +0200 (CEST) From: Lukasz Majewski To: Joseph Myers , Paul Eggert , Adhemerval Zanella Subject: [PATCH 1/2] y2038: Adjust struct __stat64_t64 to be usable by redirected {f}stat{at} calls Date: Tue, 13 Oct 2020 15:16:02 +0200 Message-Id: <20201013131603.12557-1-lukma@denx.de> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Spam-Status: No, score=-17.0 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 , Andreas Schwab , Stepan Golosunov , Alistair Francis Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" When glibc port with __WORDSIZE==32 and __TIMESIZE!=64 (e.g. armv7) will use redirected calls to {f}stat{at}64_time64 functions, it will accept the struct __stat64_t64 as its argument. To avoid errors related to proper data placement after casting from struct __stat64_t64 to struct stat{64} it is necessary to add some missing padding and update type of {__}st_ino member. By adding the unsigned int pads there is a possibility to extend struct stat from: sysdeps/unix/sysv/linux/bits/struct_stat.h with: unsigned short int __pad1; +#ifdef __USE_TIME_BITS64 + unsigned short int __timepad1; +#endif To have it binary compatible with struct __stat64_t64 --- sysdeps/unix/sysv/linux/struct_stat_time64.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sysdeps/unix/sysv/linux/struct_stat_time64.h b/sysdeps/unix/sysv/linux/struct_stat_time64.h index b85385b6f3..ca3f06c077 100644 --- a/sysdeps/unix/sysv/linux/struct_stat_time64.h +++ b/sysdeps/unix/sysv/linux/struct_stat_time64.h @@ -43,12 +43,14 @@ struct __stat64_t64 { __dev_t st_dev; /* Device. */ - __ino64_t st_ino; /* file serial number. */ + unsigned int __pad1; + __ino_t __st_ino; /* 32bit file serial number. */ __mode_t st_mode; /* File mode. */ __nlink_t st_nlink; /* Link count. */ __uid_t st_uid; /* User ID of the file's owner. */ __gid_t st_gid; /* Group ID of the file's group.*/ __dev_t st_rdev; /* Device number, if device. */ + unsigned int __pad2; __off64_t st_size; /* Size of file, in bytes. */ __blksize_t st_blksize; /* Optimal block size for I/O. */ __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ @@ -70,6 +72,7 @@ struct __stat64_t64 __fieldts64 (st_mtime); __fieldts64 (st_ctime); # endif /* __USE_XOPEN2K8 */ + __ino64_t st_ino; /* file serial number. */ }; # define _STATBUF_ST_BLKSIZE