From patchwork Thu Jul 23 19:46:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 40154 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 B3A133861001; Thu, 23 Jul 2020 19:46:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B3A133861001 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1595533613; bh=vIMtlB+62GbBMKQtA9RrHfOFMlx4EcNer3z/X9Zlx1w=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=y1NTvk9j1m2Zixaj4vzr4rtnpqx5nFb0lTzvA0SiqOHiSwEmxZjdQtwdPjRbzBQsu 2mFrBUy4rnbHnXYcPds0MxhKyc7SULm3tZe17MdZJEpbk+WbFeARDADyZiNJ1zHRcQ 7J78hpaWomFeDwTe1eecYYP0fI1WJkkpza+wXjXU= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qk1-x742.google.com (mail-qk1-x742.google.com [IPv6:2607:f8b0:4864:20::742]) by sourceware.org (Postfix) with ESMTPS id C48C33857002 for ; Thu, 23 Jul 2020 19:46:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C48C33857002 Received: by mail-qk1-x742.google.com with SMTP id d4so3165982qkk.8 for ; Thu, 23 Jul 2020 12:46:50 -0700 (PDT) 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=vIMtlB+62GbBMKQtA9RrHfOFMlx4EcNer3z/X9Zlx1w=; b=r1rx6pxZuwYUuzWWmc6V66NLJiJW4PLLKiOWo034p2oxuAimVuYVacK30fjaFsJol7 E3YHwpL+oYGMrSzL7zqie0R+7UX8mJgyd+EvfSpJkW7JapUXjpRUZyurM+iTcuoI/RBs mAwZ4ETOKXwRnQ4gblnIs+gOW+/Ko1L77ZA2+ftcCOroPWSDWVq/OojLK0s1B7Cwt3aM vzkje8eIDp6fr4U+nddyKgNaD2fDz34nB+cCMYk5LwUksSt4q0qGrL30Ct1nItJmImRo vz25QthmJjWW12IBQrxfSsyyKcG03D7CkXpBKbPri0smIo+ClaIFFWXqnU5Du9OhZ1kO gfew== X-Gm-Message-State: AOAM532i5mZN+/Aj/NoVl9/YnGcdAyLD3kk7Zrr7Ov4DV89nD+Nhk1pC btVtvgFadQFhMlqhs2K5edxOZa09iCA= X-Google-Smtp-Source: ABdhPJzEc1hLtnBFkyuTrloPTCzehgk7UoLoCDynIZ4csG0vqCSdc6maUh2VRl6ahBLsXa4mcAQxTA== X-Received: by 2002:a37:6894:: with SMTP id d142mr6776714qkc.287.1595533610099; Thu, 23 Jul 2020 12:46:50 -0700 (PDT) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id k56sm3570639qtk.61.2020.07.23.12.46.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jul 2020 12:46:49 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 01/16] linux: Always define STAT_IS_KERNEL_STAT Date: Thu, 23 Jul 2020 16:46:26 -0300 Message-Id: <20200723194641.1949404-2-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200723194641.1949404-1-adhemerval.zanella@linaro.org> References: <20200723194641.1949404-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-3.9 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, UNWANTED_LANGUAGE_BODY 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 Netto Reply-To: Adhemerval Zanella Cc: Alistair Francis Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" It allows to check for its value instead of its existence. Checked with a build for all affected ABIS. Reviewed-by: Lukasz Majewski --- sysdeps/unix/sysv/linux/alpha/kernel_stat.h | 1 + sysdeps/unix/sysv/linux/fxstat.c | 2 +- sysdeps/unix/sysv/linux/fxstatat.c | 4 ++-- sysdeps/unix/sysv/linux/hppa/kernel_stat.h | 1 + sysdeps/unix/sysv/linux/kernel_stat.h | 1 + sysdeps/unix/sysv/linux/lxstat.c | 2 +- sysdeps/unix/sysv/linux/microblaze/kernel_stat.h | 1 + sysdeps/unix/sysv/linux/mips/kernel_stat.h | 1 + sysdeps/unix/sysv/linux/powerpc/powerpc32/kernel_stat.h | 1 + sysdeps/unix/sysv/linux/sparc/sparc32/kernel_stat.h | 1 + sysdeps/unix/sysv/linux/sparc/sparc64/kernel_stat.h | 1 + sysdeps/unix/sysv/linux/xstat.c | 2 +- sysdeps/unix/sysv/linux/xstatconv.c | 2 +- sysdeps/unix/sysv/linux/xstatconv.h | 2 +- 14 files changed, 15 insertions(+), 7 deletions(-) diff --git a/sysdeps/unix/sysv/linux/alpha/kernel_stat.h b/sysdeps/unix/sysv/linux/alpha/kernel_stat.h index d637e099cf..9bcc96c577 100644 --- a/sysdeps/unix/sysv/linux/alpha/kernel_stat.h +++ b/sysdeps/unix/sysv/linux/alpha/kernel_stat.h @@ -85,5 +85,6 @@ struct glibc21_stat long __glibc_reserved[4]; }; +#define STAT_IS_KERNEL_STAT 0 #define XSTAT_IS_XSTAT64 1 #define STATFS_IS_STATFS64 0 diff --git a/sysdeps/unix/sysv/linux/fxstat.c b/sysdeps/unix/sysv/linux/fxstat.c index ce474dcd47..a88404b5c3 100644 --- a/sysdeps/unix/sysv/linux/fxstat.c +++ b/sysdeps/unix/sysv/linux/fxstat.c @@ -38,7 +38,7 @@ __fxstat (int vers, int fd, struct stat *buf) if (vers == _STAT_VER_KERNEL) return INLINE_SYSCALL (fstat, 2, fd, buf); -#ifdef STAT_IS_KERNEL_STAT +#if STAT_IS_KERNEL_STAT return INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL); #else struct kernel_stat kbuf; diff --git a/sysdeps/unix/sysv/linux/fxstatat.c b/sysdeps/unix/sysv/linux/fxstatat.c index 3eb898e322..937fec45c2 100644 --- a/sysdeps/unix/sysv/linux/fxstatat.c +++ b/sysdeps/unix/sysv/linux/fxstatat.c @@ -37,7 +37,7 @@ int __fxstatat (int vers, int fd, const char *file, struct stat *st, int flag) { int result; -#ifdef STAT_IS_KERNEL_STAT +#if STAT_IS_KERNEL_STAT # define kst (*st) #else struct kernel_stat kst; @@ -46,7 +46,7 @@ __fxstatat (int vers, int fd, const char *file, struct stat *st, int flag) result = INTERNAL_SYSCALL_CALL (newfstatat, fd, file, &kst, flag); if (!__glibc_likely (INTERNAL_SYSCALL_ERROR_P (result))) { -#ifdef STAT_IS_KERNEL_STAT +#if STAT_IS_KERNEL_STAT return 0; #else return __xstat_conv (vers, &kst, st); diff --git a/sysdeps/unix/sysv/linux/hppa/kernel_stat.h b/sysdeps/unix/sysv/linux/hppa/kernel_stat.h index a3ac53a1ef..0cbd010fc3 100644 --- a/sysdeps/unix/sysv/linux/hppa/kernel_stat.h +++ b/sysdeps/unix/sysv/linux/hppa/kernel_stat.h @@ -30,5 +30,6 @@ struct kernel_stat { #define _HAVE_STAT_NSEC #define _HAVE_STAT64_NSEC +#define STAT_IS_KERNEL_STAT 0 #define XSTAT_IS_XSTAT64 0 #define STATFS_IS_STATFS64 0 diff --git a/sysdeps/unix/sysv/linux/kernel_stat.h b/sysdeps/unix/sysv/linux/kernel_stat.h index eecc962de3..ff54a4524c 100644 --- a/sysdeps/unix/sysv/linux/kernel_stat.h +++ b/sysdeps/unix/sysv/linux/kernel_stat.h @@ -34,5 +34,6 @@ struct kernel_stat #define _HAVE_STAT64___ST_INO #define _HAVE_STAT64_NSEC +#define STAT_IS_KERNEL_STAT 0 #define XSTAT_IS_XSTAT64 0 #define STATFS_IS_STATFS64 0 diff --git a/sysdeps/unix/sysv/linux/lxstat.c b/sysdeps/unix/sysv/linux/lxstat.c index e0cfc4f1fa..dcd685873d 100644 --- a/sysdeps/unix/sysv/linux/lxstat.c +++ b/sysdeps/unix/sysv/linux/lxstat.c @@ -37,7 +37,7 @@ __lxstat (int vers, const char *name, struct stat *buf) if (vers == _STAT_VER_KERNEL) return INLINE_SYSCALL (lstat, 2, name, buf); -#ifdef STAT_IS_KERNEL_STAT +#if STAT_IS_KERNEL_STAT return INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL); #else struct kernel_stat kbuf; diff --git a/sysdeps/unix/sysv/linux/microblaze/kernel_stat.h b/sysdeps/unix/sysv/linux/microblaze/kernel_stat.h index 765e0dca67..4daaedc4b6 100644 --- a/sysdeps/unix/sysv/linux/microblaze/kernel_stat.h +++ b/sysdeps/unix/sysv/linux/microblaze/kernel_stat.h @@ -48,5 +48,6 @@ struct kernel_stat #define _HAVE_STAT64___UNUSED5 }; +#define STAT_IS_KERNEL_STAT 0 #define XSTAT_IS_XSTAT64 0 #define STATFS_IS_STATFS64 0 diff --git a/sysdeps/unix/sysv/linux/mips/kernel_stat.h b/sysdeps/unix/sysv/linux/mips/kernel_stat.h index 388df1bfff..e75f3e805b 100644 --- a/sysdeps/unix/sysv/linux/mips/kernel_stat.h +++ b/sysdeps/unix/sysv/linux/mips/kernel_stat.h @@ -56,5 +56,6 @@ struct kernel_stat }; #endif +#define STAT_IS_KERNEL_STAT 0 #define XSTAT_IS_XSTAT64 0 #define STATFS_IS_STATFS64 0 diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/kernel_stat.h b/sysdeps/unix/sysv/linux/powerpc/powerpc32/kernel_stat.h index c5948a4d3c..75610b8df3 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/kernel_stat.h +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/kernel_stat.h @@ -47,5 +47,6 @@ struct kernel_stat #define _HAVE_STAT64___PAD2 #define _HAVE_STAT64_NSEC +#define STAT_IS_KERNEL_STAT 0 #define XSTAT_IS_XSTAT64 0 #define STATFS_IS_STATFS64 0 diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/kernel_stat.h b/sysdeps/unix/sysv/linux/sparc/sparc32/kernel_stat.h index a4416009f1..5c8cacaf67 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/kernel_stat.h +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/kernel_stat.h @@ -31,5 +31,6 @@ struct kernel_stat #define _HAVE_STAT_NSEC #define _HAVE_STAT64_NSEC +#define STAT_IS_KERNEL_STAT 0 #define XSTAT_IS_XSTAT64 0 #define STATFS_IS_STATFS64 0 diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/kernel_stat.h b/sysdeps/unix/sysv/linux/sparc/sparc64/kernel_stat.h index 30afb553b9..d14b2487ac 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/kernel_stat.h +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/kernel_stat.h @@ -44,5 +44,6 @@ struct kernel_stat64 long int __glibc_reserved[3]; }; +#define STAT_IS_KERNEL_STAT 0 #define XSTAT_IS_XSTAT64 1 #define STATFS_IS_STATFS64 0 diff --git a/sysdeps/unix/sysv/linux/xstat.c b/sysdeps/unix/sysv/linux/xstat.c index a93d635611..76c90e20c7 100644 --- a/sysdeps/unix/sysv/linux/xstat.c +++ b/sysdeps/unix/sysv/linux/xstat.c @@ -37,7 +37,7 @@ __xstat (int vers, const char *name, struct stat *buf) if (vers == _STAT_VER_KERNEL) return INLINE_SYSCALL (stat, 2, name, buf); -#ifdef STAT_IS_KERNEL_STAT +#if STAT_IS_KERNEL_STAT return INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL); #else struct kernel_stat kbuf; diff --git a/sysdeps/unix/sysv/linux/xstatconv.c b/sysdeps/unix/sysv/linux/xstatconv.c index c01fb00a3a..3622a82cd0 100644 --- a/sysdeps/unix/sysv/linux/xstatconv.c +++ b/sysdeps/unix/sysv/linux/xstatconv.c @@ -20,7 +20,7 @@ #include #include -#ifdef STAT_IS_KERNEL_STAT +#if STAT_IS_KERNEL_STAT /* Dummy. */ struct kernel_stat; diff --git a/sysdeps/unix/sysv/linux/xstatconv.h b/sysdeps/unix/sysv/linux/xstatconv.h index 39102c9469..5319236cae 100644 --- a/sysdeps/unix/sysv/linux/xstatconv.h +++ b/sysdeps/unix/sysv/linux/xstatconv.h @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ -#ifndef STAT_IS_KERNEL_STAT +#if !STAT_IS_KERNEL_STAT extern int __xstat_conv (int vers, struct kernel_stat *kbuf, void *ubuf) attribute_hidden; extern int __xstat64_conv (int vers, struct kernel_stat *kbuf, void *ubuf)