From patchwork Mon Feb 8 21:49:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 41976 X-Patchwork-Delegate: carlos@redhat.com 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 16F37395042D; Mon, 8 Feb 2021 21:50:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 16F37395042D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1612821016; bh=EpcPtI7CyvloYaB7CBHj1jG8nwbvot9lZ2M11k6wqMg=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=lAaZaujn8J7cLcaSh3IFESwjUec7/6lvqqhhhWoKIgjuVITbyb5VLpGYeEvE4GVrW 17zfD5lzHdnQq5ERLGFt50p6mDptQwN22+ytQ7pH7jxE4gasjme+/nkzmJxQtTuiXv vn1F/RUfoqE4+cmX744YkWupTFbblJUVehQGwR1w= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qk1-x72c.google.com (mail-qk1-x72c.google.com [IPv6:2607:f8b0:4864:20::72c]) by sourceware.org (Postfix) with ESMTPS id BCDEA3950423 for ; Mon, 8 Feb 2021 21:50:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org BCDEA3950423 Received: by mail-qk1-x72c.google.com with SMTP id a19so16131904qka.2 for ; Mon, 08 Feb 2021 13:50:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=EpcPtI7CyvloYaB7CBHj1jG8nwbvot9lZ2M11k6wqMg=; b=MLHzQDYj6jCKvUlDOVDU6gVSFnYIpvrW55zQbV08AQtPnJ6edaJ6hi31JOnUjz8rme SJeu1i1MbFpiDv6tGtdAb7y0S9giJ4Ruw2ttNdHNSoMx0kTOUPk5XxCz0W0ygoyYKeYZ OaJwUwjsya4/wKS9BIBMGTYRlRxA1l9UTlRCMZN13NQG94F3cC3FiZm51zeuJ2xTYv+D +Yt452/O8BgRF3UmZPGNl3QW7h0H4CJGaUufzL6ThPh3dA6fVa/jvSW2pv42UoMtJczh qOr1caMy36PrJMbG5LNEZBZEpsQ3JzOCMEW5I2vzeO8ShyGUq1fa6wmTxyIIXtHSLCgh BFUg== X-Gm-Message-State: AOAM532fQstnXY3wcNc/5IJFs+GGYqIq9+lS0P5UNCzmkIkrN3ALH6lB f3wkgCbCU5RINCbzAokjREnC6m+XbI1tKw== X-Google-Smtp-Source: ABdhPJxXwo74/Idkb5YGT/gF6bgsV3pqLDDbJVZyeNZU/6oPBd5JLVqavD4KOCzdlrBnCJahd/sK6Q== X-Received: by 2002:a05:620a:530:: with SMTP id h16mr19107184qkh.136.1612821012193; Mon, 08 Feb 2021 13:50:12 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id e15sm12720078qtq.43.2021.02.08.13.50.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Feb 2021 13:50:11 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 10/10] linux: Remove stat-check.c Date: Mon, 8 Feb 2021 18:49:36 -0300 Message-Id: <20210208214936.1502047-11-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210208214936.1502047-1-adhemerval.zanella@linaro.org> References: <20210208214936.1502047-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, 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: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" The check is moved to LFS fstatat implementation (since it is the code that actually implements the syscall). Reviewed-by: Carlos O'Donell --- sysdeps/unix/sysv/linux/fstatat64.c | 12 ++++++++ sysdeps/unix/sysv/linux/generic/Makefile | 2 +- sysdeps/unix/sysv/linux/generic/stat-check.c | 29 -------------------- 3 files changed, 13 insertions(+), 30 deletions(-) delete mode 100644 sysdeps/unix/sysv/linux/generic/stat-check.c diff --git a/sysdeps/unix/sysv/linux/fstatat64.c b/sysdeps/unix/sysv/linux/fstatat64.c index ab41f19e94..a609b4d3ff 100644 --- a/sysdeps/unix/sysv/linux/fstatat64.c +++ b/sysdeps/unix/sysv/linux/fstatat64.c @@ -28,6 +28,18 @@ #include #include +#if __TIMESIZE == 64 \ + && (__WORDSIZE == 32 \ + && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32)) +/* Sanity check to avoid newer 32-bit ABI to support non-LFS calls. */ +_Static_assert (sizeof (__off_t) == sizeof (__off64_t), + "__blkcnt_t and __blkcnt64_t must match"); +_Static_assert (sizeof (__ino_t) == sizeof (__ino64_t), + "__blkcnt_t and __blkcnt64_t must match"); +_Static_assert (sizeof (__blkcnt_t) == sizeof (__blkcnt64_t), + "__blkcnt_t and __blkcnt64_t must match"); +#endif + int __fstatat64_time64 (int fd, const char *file, struct __stat64_t64 *buf, int flag) diff --git a/sysdeps/unix/sysv/linux/generic/Makefile b/sysdeps/unix/sysv/linux/generic/Makefile index 124f83a0ab..7e27e79772 100644 --- a/sysdeps/unix/sysv/linux/generic/Makefile +++ b/sysdeps/unix/sysv/linux/generic/Makefile @@ -1,3 +1,3 @@ ifeq ($(subdir),misc) -sysdep_routines += epoll_create inotify_init stat-check +sysdep_routines += epoll_create inotify_init endif diff --git a/sysdeps/unix/sysv/linux/generic/stat-check.c b/sysdeps/unix/sysv/linux/generic/stat-check.c deleted file mode 100644 index e09264dd3a..0000000000 --- a/sysdeps/unix/sysv/linux/generic/stat-check.c +++ /dev/null @@ -1,29 +0,0 @@ -/* Static assert for __blkcnt64_t when __INO_T_MATCHES_INO64_T is defined. - Copyright (C) 2019-2021 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - . */ - -#include -#include - -/* This is due to the layout code in bits/stat.h and the overflow handling in - wordsize-32/overflow.h, requiring either all or none of the three types - concerned to have padding. */ - -#if defined __INO_T_MATCHES_INO64_T -_Static_assert (sizeof (__blkcnt_t) == sizeof (__blkcnt64_t), - "__blkcnt_t and __blkcnt64_t must match"); -#endif