From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: from second.openwall.net (second.openwall.net [193.110.157.125]) by inbox.vuxu.org (Postfix) with SMTP id DEFEF220AB for ; Sat, 24 Feb 2024 17:57:54 +0100 (CET) Received: (qmail 14306 invoked by uid 550); 24 Feb 2024 16:54:25 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 14268 invoked from network); 24 Feb 2024 16:54:25 -0000 Date: Sat, 24 Feb 2024 11:57:59 -0500 From: Rich Felker To: Duncan Bellamy Cc: info@bnoordhuis.nl, musl@lists.openwall.com Message-ID: <20240224165757.GB4163@brightrain.aerifal.cx> References: <20200119121247.37310-1-info@bnoordhuis.nl> <20220831190735.52016-1-dunk@denkimushi.com> <20220831190735.52016-3-dunk@denkimushi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220831190735.52016-3-dunk@denkimushi.com> User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [musl] [PATCH 2/2] V3 src/stat/fstatat.c use new statx define On Wed, Aug 31, 2022 at 08:07:35PM +0100, Duncan Bellamy wrote: > --- > src/stat/fstatat.c | 30 +++--------------------------- > 1 file changed, 3 insertions(+), 27 deletions(-) > > diff --git a/src/stat/fstatat.c b/src/stat/fstatat.c > index 74c51cf5..6b44f48a 100644 > --- a/src/stat/fstatat.c > +++ b/src/stat/fstatat.c > @@ -1,4 +1,5 @@ > #define _BSD_SOURCE > +#define _GNU_SOURCE > #include > #include > #include > @@ -7,36 +8,11 @@ > #include > #include "syscall.h" > > -struct statx { > - uint32_t stx_mask; > - uint32_t stx_blksize; > - uint64_t stx_attributes; > - uint32_t stx_nlink; > - uint32_t stx_uid; > - uint32_t stx_gid; > - uint16_t stx_mode; > - uint16_t pad1; > - uint64_t stx_ino; > - uint64_t stx_size; > - uint64_t stx_blocks; > - uint64_t stx_attributes_mask; > - struct { > - int64_t tv_sec; > - uint32_t tv_nsec; > - int32_t pad; > - } stx_atime, stx_btime, stx_ctime, stx_mtime; > - uint32_t stx_rdev_major; > - uint32_t stx_rdev_minor; > - uint32_t stx_dev_major; > - uint32_t stx_dev_minor; > - uint64_t spare[14]; > -}; > - > static int fstatat_statx(int fd, const char *restrict path, struct stat *restrict st, int flag) > { > struct statx stx; > > - int ret = __syscall(SYS_statx, fd, path, flag, 0x7ff, &stx); > + int ret = __syscall(SYS_statx, fd, path, flag, STATX_BASIC_STATS, &stx); > if (ret) return ret; > > *st = (struct stat){ > @@ -152,6 +128,6 @@ int __fstatat(int fd, const char *restrict path, struct stat *restrict st, int f > > weak_alias(__fstatat, fstatat); > > -#if !_REDIR_TIME64 > +#if !_REDIR_TIME64 && !defined(_GNU_SOURCE) > weak_alias(fstatat, fstatat64); > #endif > -- > 2.32.1 (Apple Git-133) I don't understand why the condition for the glibc-compat alias was changed here. It seems like an unrelated and unmotivated change that slipped in... Rich