From patchwork Mon Feb 8 21:49:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 41975 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 E6C18394EC18; Mon, 8 Feb 2021 21:50:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E6C18394EC18 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1612821014; bh=9XdBatFE3YjZxVFHnWvsSkGzmlzlvsMVTBkM9q3LLBo=; 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=eAwAqY2LZ1zxmtTvzdUbNU3Ta51TuDzmOmsrkgyJAacFABpeJA7AiIZMvaeUJTfp9 KJ5SG/G/ywW5J5TcK/f2b0BXOiGw/dEqPP88t68ZH1tffvj1imviOrZgatTYxkxG8b EqA9u46GmB4BZA/2GmKyc+DgH4VfGE0Oqhel8O+8= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qt1-x82a.google.com (mail-qt1-x82a.google.com [IPv6:2607:f8b0:4864:20::82a]) by sourceware.org (Postfix) with ESMTPS id 3CD80394EC32 for ; Mon, 8 Feb 2021 21:50:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 3CD80394EC32 Received: by mail-qt1-x82a.google.com with SMTP id n28so4522067qtv.12 for ; Mon, 08 Feb 2021 13:50:11 -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=9XdBatFE3YjZxVFHnWvsSkGzmlzlvsMVTBkM9q3LLBo=; b=tvCsv4vlT4Coflkyc2eybwEiU6eJrq+swesPheRI4dfRjfdEjaemxFsMbgo6krB5CN 0AV9H507fe1JJ7nNnyso6lNblo73eFyGt2iZekhdtbvt54tGwyhfda3ZCu+kCR9deDi+ DB1ntkwWUMGdG1n9kjojjBPg6C2qhzY59JuTeOQcAl2zaMLLJRR/XaabMBdZ28yYH3/q DSLhcIItN+kLEYHd2txrEwy3kZrW+u0neH/32/6A6rzxutqQliXziPahvmVSgoVpU/yu H3H3Cv7VSjyX3zagC/Cs2k0Mi9nvh/iryu5yQGUrFEMlfUo56l9Bkh3xh60nI+NeS9ps wrKA== X-Gm-Message-State: AOAM531gLGRxmXX4qzWiV8UrAUYUrJfNY4la9tmIjxmE7adb4onjLzuV T/VL/7CCStfmfbiXwF85EczPdAcpU6rzTQ== X-Google-Smtp-Source: ABdhPJzuP3dxc03LI2qoN7F8/WfAZWgzj1BW96Ls1yTjh+Apw8qcibgIWcnlvM/eHfStVXZOJe34NA== X-Received: by 2002:ac8:8b1:: with SMTP id v46mr5029288qth.252.1612821010654; Mon, 08 Feb 2021 13:50:10 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id e15sm12720078qtq.43.2021.02.08.13.50.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Feb 2021 13:50:10 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 09/10] linux: Remove overflow.h Date: Mon, 8 Feb 2021 18:49:35 -0300 Message-Id: <20210208214936.1502047-10-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 header is not used anywhere, the required functions are provided by other implementations. Reviewed-by: Carlos O'Donell --- .../sysv/linux/generic/wordsize-32/overflow.h | 69 ------------------- 1 file changed, 69 deletions(-) delete mode 100644 sysdeps/unix/sysv/linux/generic/wordsize-32/overflow.h diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/overflow.h b/sysdeps/unix/sysv/linux/generic/wordsize-32/overflow.h deleted file mode 100644 index f2a58d654f..0000000000 --- a/sysdeps/unix/sysv/linux/generic/wordsize-32/overflow.h +++ /dev/null @@ -1,69 +0,0 @@ -/* Overflow tests for stat, statfs, and lseek functions. - Copyright (C) 2011-2021 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Chris Metcalf , 2011. - - 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 -#include - -/* Test for overflows of structures where we ask the kernel to fill them - in with standard 64-bit syscalls but return them through APIs that - only expose the low 32 bits of some fields. */ - -static inline off_t lseek_overflow (loff_t res) -{ - off_t retval = (off_t) res; - if (retval == res) - return retval; - - __set_errno (EOVERFLOW); - return (off_t) -1; -} - -static inline int stat_overflow (struct stat *buf) -{ -#if defined __INO_T_MATCHES_INO64_T - return 0; -#else - if (buf->__st_ino_pad == 0 && buf->__st_size_pad == 0 - && buf->__st_blocks_pad == 0) - return 0; - - __set_errno (EOVERFLOW); - return -1; -#endif -} - -/* Note that f_files and f_ffree may validly be a sign-extended -1. */ -static inline int statfs_overflow (struct statfs *buf) -{ -#if __STATFS_MATCHES_STATFS64 - return 0; -#else - if (buf->__f_blocks_pad == 0 && buf->__f_bfree_pad == 0 - && buf->__f_bavail_pad == 0 - && (buf->__f_files_pad == 0 - || (buf->f_files == -1U && buf->__f_files_pad == -1)) - && (buf->__f_ffree_pad == 0 - || (buf->f_ffree == -1U && buf->__f_ffree_pad == -1))) - return 0; - - __set_errno (EOVERFLOW); - return -1; -#endif -}