From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: Florian Weimer <fweimer@redhat.com>,
Adhemerval Zanella via Libc-alpha <libc-alpha@sourceware.org>
Cc: Samuel Thibault <samuel.thibault@gnu.org>,
Sergey Bugaev <bugaevc@gmail.com>
Subject: Re: [PATCH v2] io: Refactor close_range and closefrom
Date: Wed, 24 Nov 2021 08:36:16 -0300 [thread overview]
Message-ID: <ab104416-ebb3-713b-7be9-979b44761c57@linaro.org> (raw)
In-Reply-To: <87r1b5op82.fsf@oldenburg.str.redhat.com>
On 24/11/2021 06:52, Florian Weimer wrote:
> * Adhemerval Zanella via Libc-alpha:
>
>> diff --git a/include/unistd.h b/include/unistd.h
>> index 7849562c42..927d249380 100644
>> --- a/include/unistd.h
>> +++ b/include/unistd.h
>> @@ -3,6 +3,9 @@
>>
>> # ifndef _ISOMAC
>>
>> +# include <stdbool.h>
>> +# include <kernel-features.h>
>> +
>> libc_hidden_proto (_exit, __noreturn__)
>> # ifndef NO_RTLD_HIDDEN
>> rtld_hidden_proto (_exit, __noreturn__)
>> @@ -158,7 +161,14 @@ extern int __brk (void *__addr) attribute_hidden;
>> extern int __close (int __fd);
>> libc_hidden_proto (__close)
>> extern int __libc_close (int __fd);
>> +#if __ASSUME_CLOSE_RANGE
>> +static inline _Bool __closefrom_fallback (int __lowfd, _Bool dirfd_fallback)
>> +{
>> + return false;
>> +}
>> +#else
>> extern _Bool __closefrom_fallback (int __lowfd, _Bool) attribute_hidden;
>> +#endif
>> extern ssize_t __read (int __fd, void *__buf, size_t __nbytes);
>> libc_hidden_proto (__read)
>> extern ssize_t __write (int __fd, const void *__buf, size_t __n);
>
> #if indentation seems off.
Ack.
>
> I expect this will break the Hurd build because it does not define
> __ASSUME_CLOSE_RANGE in its <kernel-features.h>.
> diff --git a/sysdeps/mach/hurd/kernel-features.h b/sysdeps/mach/hurd/kernel-features.h
> index 7d4eaee0a6..5fd37a6d7b 100644
> --- a/sysdeps/mach/hurd/kernel-features.h
> +++ b/sysdeps/mach/hurd/kernel-features.h
> @@ -19,3 +19,5 @@
> /* This file can define __ASSUME_* macros checked by certain source files.
> Almost none of these are used outside of sysdeps/unix/sysv/linux code.
> But those referring to POSIX-level features like O_* flags can be. */
> +
> +#define __ASSUME_CLOSE_RANGE 1
It does add it here (I also checked with a build for i688-gnu).
>
> Thanks,
> Florian
>
next prev parent reply other threads:[~2021-11-24 11:36 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-08 17:28 Adhemerval Zanella
2021-11-23 18:29 ` Adhemerval Zanella
2021-11-24 9:52 ` Florian Weimer
2021-11-24 11:36 ` Adhemerval Zanella [this message]
2021-11-24 12:03 ` Florian Weimer
2021-11-24 12:17 ` Samuel Thibault
2021-11-24 12:20 ` Adhemerval Zanella
2021-11-24 12:43 ` 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=ab104416-ebb3-713b-7be9-979b44761c57@linaro.org \
--to=adhemerval.zanella@linaro.org \
--cc=bugaevc@gmail.com \
--cc=fweimer@redhat.com \
--cc=libc-alpha@sourceware.org \
--cc=samuel.thibault@gnu.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).