public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: Stafford Horne <shorne@gmail.com>,
	GLIBC patches <libc-alpha@sourceware.org>
Subject: Re: [PATCH] linux: Define STAT64_IS_KERNEL_STAT64 by default
Date: Mon, 22 Nov 2021 10:00:31 -0300	[thread overview]
Message-ID: <7bea3e23-bbde-e5c8-137d-1fc105c1a7b7@linaro.org> (raw)
In-Reply-To: <20211120210901.3991578-1-shorne@gmail.com>



On 20/11/2021 18:09, Stafford Horne via Libc-alpha wrote:
> In commit 36260d5035 ("linux: Set default kernel_stat.h to LFS") the
> default for STAT64_IS_KERNEL_STAT64 was removed.  This patch adds it
> back.
> 
> For architectures that want to used the default kernel_stat.h and do not
> have __NR_newfstatat, STAT64_IS_KERNEL_STAT64 needs to be defined.  Set
> the default as 1 as modern port's stat64 struct should match the kernel
> stat64 layout.
> 
> I tested this on the OpenRISC port and it seems to work fine.  Currently,
> all archs that use the default kernel_stat.h define __NR_newfstatat so
> they will not use the STAT64_IS_KERNEL_STAT64 macro.  However, arc seems
> to be an outlier it uses the default kernel_stat.h, but does not define
> __NR_newfstatat or __NR_fstatat64 I am not clear how arc works here.

arc and usually newer 32-bit ports will only use __NR_statx:

138 #if (__WORDSIZE == 32 \
139      && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32)) \
140      || defined STAT_HAS_TIME32
141 # define FSTATAT_USE_STATX 1
142 #else
143 # define FSTATAT_USE_STATX 0
144 #endif

The patch looks ok, but it seems strange that ork1 requires it since it
setting minimum required kernel to 5.10. I would expect that __ASSUME_STATX
would be defined and only fstatat64_time64_statx would be used.

> ---
>  sysdeps/unix/sysv/linux/kernel_stat.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/sysdeps/unix/sysv/linux/kernel_stat.h b/sysdeps/unix/sysv/linux/kernel_stat.h
> index 6c1b175cb4..b8c376f41e 100644
> --- a/sysdeps/unix/sysv/linux/kernel_stat.h
> +++ b/sysdeps/unix/sysv/linux/kernel_stat.h
> @@ -20,3 +20,4 @@
>  #define XSTAT_IS_XSTAT64     1
>  #define STATFS_IS_STATFS64   __STATFS_MATCHES_STATFS64
>  #define STAT_IS_KERNEL_STAT  1
> +#define STAT64_IS_KERNEL_STAT64 1
> 


  reply	other threads:[~2021-11-22 13:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-20 21:09 Stafford Horne
2021-11-22 13:00 ` Adhemerval Zanella [this message]
2021-11-23 21:39   ` Stafford Horne
2021-11-24 15:50     ` Adhemerval Zanella
2021-11-24 21:29       ` Stafford Horne
2021-11-25 12:53         ` Adhemerval Zanella

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7bea3e23-bbde-e5c8-137d-1fc105c1a7b7@linaro.org \
    --to=adhemerval.zanella@linaro.org \
    --cc=libc-alpha@sourceware.org \
    --cc=shorne@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).