From patchwork Sun Nov 8 16:42:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 40966 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 952503854830; Sun, 8 Nov 2020 16:42:12 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from hera.aquilenet.fr (hera.aquilenet.fr [IPv6:2a0c:e300::1]) by sourceware.org (Postfix) with ESMTPS id 983343857C78 for ; Sun, 8 Nov 2020 16:42:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 983343857C78 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=ens-lyon.org Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=samuel.thibault@ens-lyon.org Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 8E3876EA; Sun, 8 Nov 2020 17:42:08 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DZLSbMR7UcyB; Sun, 8 Nov 2020 17:42:07 +0100 (CET) Received: from function.youpi.perso.aquilenet.fr (lfbn-bor-1-56-204.w90-50.abo.wanadoo.fr [90.50.148.204]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 44F1B642; Sun, 8 Nov 2020 17:42:07 +0100 (CET) Received: from samy by function.youpi.perso.aquilenet.fr with local (Exim 4.94) (envelope-from ) id 1kbnlU-00AFir-MX; Sun, 08 Nov 2020 17:42:04 +0100 From: Samuel Thibault To: libc-alpha@sourceware.org Subject: [PATCH] include/sys/stat.h: Add __USE_FILE_OFFSET64 redirection Date: Sun, 8 Nov 2020 17:42:03 +0100 Message-Id: <20201108164203.2443643-1-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_NEUTRAL, 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: commit-hurd@gnu.org Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Tests use include/sys/stat.h, which redirects the tests' {,l,f}stat calls to __{,l,f}xstat calls. When a test is specifying __USE_FILE_OFFSET64 (such as support/test-container.c), this becomes bogus because while {,l,f}stat have the 64bit redirection, __{,l,f}xstat did not have yet. This adds them. --- include/sys/stat.h | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/include/sys/stat.h b/include/sys/stat.h index 108cb0c9bf..692850740f 100644 --- a/include/sys/stat.h +++ b/include/sys/stat.h @@ -29,14 +29,25 @@ in_blkcnt_t_range (__blkcnt64_t v) } /* Now define the internal interfaces. */ +#ifndef __USE_FILE_OFFSET64 extern int __stat (const char *__file, struct stat *__buf); -extern int __stat64 (const char *__file, struct stat64 *__buf); extern int __fstat (int __fd, struct stat *__buf); -extern int __fstat64 (int __fd, struct stat64 *__buf); extern int __lstat (const char *__file, struct stat *__buf); -extern int __lstat64 (const char *__file, struct stat64 *__buf); extern int __fstatat (int dirfd, const char *pathname, struct stat *buf, int flags); +#else +extern int __REDIRECT_NTH (__stat, + (const char *__file, struct stat *__buf), __stat64); +extern int __REDIRECT_NTH (__fstat, + (int __fd, struct stat *__buf), __fstat64); +extern int __REDIRECT_NTH (__lstat, + (const char *__file, struct stat *__buf), __lstat64); +extern int __REDIRECT_NTH(__fstatat, + (int dirfd, const char *pathname, struct stat *buf, int flags), __fstatat64); +#endif +extern int __stat64 (const char *__file, struct stat64 *__buf); +extern int __fstat64 (int __fd, struct stat64 *__buf); +extern int __lstat64 (const char *__file, struct stat64 *__buf); extern int __fstatat64 (int dirfd, const char *pathname, struct stat64 *buf, int flags); # if IS_IN (libc) || (IS_IN (rtld) && !defined NO_RTLD_HIDDEN) @@ -82,12 +93,25 @@ extern int __xmknod (int __ver, const char *__path, __mode_t __mode, extern int __xmknodat (int __ver, int __fd, const char *__path, __mode_t __mode, __dev_t *__dev); +#ifndef __USE_FILE_OFFSET64 int __fxstat (int __ver, int __fildes, struct stat *__stat_buf); int __xstat (int __ver, const char *__filename, struct stat *__stat_buf); int __lxstat (int __ver, const char *__filename, struct stat *__stat_buf); int __fxstatat (int __ver, int __fildes, const char *__filename, struct stat *__stat_buf, int __flag); +#else +int __REDIRECT_NTH (__fxstat, + (int __ver, int __fildes, struct stat *__stat_buf), __fxstat64); +int __REDIRECT_NTH (__xstat, + (int __ver, const char *__filename, + struct stat *__stat_buf), __xstat64); +int __REDIRECT_NTH (__lxstat, + (int __ver, const char *__filename, struct stat *__stat_buf), __lxstat64); +int __REDIRECT_NTH (__fxstatat, + (int __ver, int __fildes, const char *__filename, + struct stat *__stat_buf, int __flag), __fxstatat64); +#endif int __fxstat64 (int ver, int __fildes, struct stat64 *__stat_buf); int __xstat64 (int ver, const char *__filename, struct stat64 *__stat_buf); int __lxstat64 (int ver, const char *__filename, struct stat64 *__stat_buf);