public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
To: Florian Weimer <fweimer@redhat.com>,
	Adhemerval Zanella via Libc-alpha <libc-alpha@sourceware.org>
Cc: Mateusz Guzik <mjguzik@gmail.com>,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCH] io: Do not implement fstat with fstatat
Date: Mon, 11 Sep 2023 10:11:12 -0300	[thread overview]
Message-ID: <c34aeae7-93c0-cf2d-af4c-61d8fe45b47a@linaro.org> (raw)
In-Reply-To: <87ledjxc33.fsf@oldenburg.str.redhat.com>



On 06/09/23 17:48, Florian Weimer wrote:
> * Adhemerval Zanella via Libc-alpha:
> 
>> diff --git a/sysdeps/unix/sysv/linux/fstat64.c b/sysdeps/unix/sysv/linux/fstat64.c
>> index 124384e57f..a7f4935a01 100644
>> --- a/sysdeps/unix/sysv/linux/fstat64.c
>> +++ b/sysdeps/unix/sysv/linux/fstat64.c
> 
>>  int
>>  __fstat64_time64 (int fd, struct __stat64_t64 *buf)
>>  {
>> +#if !FSTATAT_USE_STATX
>> +# if XSTAT_IS_XSTAT64
>> +#  ifdef __NR_newfstatat
>> +  /* 64-bit kABI, e.g. aarch64, ia64, powerpc64*, s390x, riscv64, and
>> +     x86_64.  */
>> +  return INLINE_SYSCALL_CALL (fstat, fd, buf);
> 
> It's a bit suspicious to check for __NR_newfstatat an then use fstat.
> Could you add a comment to explain this?
> 
> Surprisingly it compiles on all architectures.

I used the same fstatat logic, but using __NR_fstat should be fine.  It
build fine because for the affected architectures, newfstatat was added
for archs that already supported fstat.

> 
> Thanks,
> Florian
> 

  reply	other threads:[~2023-09-11 13:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-05 20:34 Adhemerval Zanella
2023-09-05 20:48 ` Mateusz Guzik
2023-09-05 20:56   ` Adhemerval Zanella Netto
2023-09-05 21:03     ` Mateusz Guzik
2023-09-06 20:48 ` Florian Weimer
2023-09-11 13:11   ` Adhemerval Zanella Netto [this message]
2023-09-11 19:32     ` Linus Torvalds
2023-09-11 22:10       ` Adhemerval Zanella Netto
2023-09-12  5:31         ` Florian Weimer
2023-09-12 13:13           ` Adhemerval Zanella Netto

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=c34aeae7-93c0-cf2d-af4c-61d8fe45b47a@linaro.org \
    --to=adhemerval.zanella@linaro.org \
    --cc=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=mjguzik@gmail.com \
    --cc=torvalds@linux-foundation.org \
    /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).