From: Rich Felker <dalias@libc.org>
To: Natanael Copa <ncopa@alpinelinux.org>
Cc: musl@lists.openwall.com
Subject: Re: [musl] [PATCH] add close_range() syscall wrapper
Date: Fri, 1 Sep 2023 11:06:12 -0400 [thread overview]
Message-ID: <20230901150612.GA4163@brightrain.aerifal.cx> (raw)
In-Reply-To: <20230901165553.3755a1c7@ncopa-desktop.lan>
On Fri, Sep 01, 2023 at 04:55:53PM +0200, Natanael Copa wrote:
> On Fri, 1 Sep 2023 09:57:34 -0400
> Rich Felker <dalias@libc.org> wrote:
>
>
> > > +int close_range(unsigned int first, unsigned int last, int flags)
> > > +{
> > > + return __syscall_ret(syscall(SYS_close_range, first, last, flags));
> > > +}
> > > --
> > > 2.42.0
> >
> > This is double-processing errno. You need either return
> > __syscall_ret(__syscall(...)) (note the second __) or just return
> > syscall(...) (the syscall macro without __ automatically does the
> > __syscall_ret).
>
> Ah, ok, I'll send a v2 patch.
>
> > Aside from that, I think there's a question whether, if we support
> > this as a function rather than leaving it to the application to use
> > the syscall, we should provide a fallback for ENOSYS. I'm not sure,
> > but it's something that should be considered before adding it.
>
> It was mentioned earlier that CPython expects close_range() to
> async-safe, and that glibc does not provide fallback. I would prefer
> that musl does not provide fallback.
>
> https://www.openwall.com/lists/musl/2022/08/18/4
If musl were to provide a fallback it would be AS-safe.
Rich
next prev parent reply other threads:[~2023-09-01 15:06 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-01 8:02 Natanael Copa
2023-09-01 13:57 ` Rich Felker
2023-09-01 14:55 ` Natanael Copa
2023-09-01 15:06 ` Rich Felker [this message]
2023-09-01 14:58 ` [musl] [PATCH v2] " Natanael Copa
2024-08-01 9:43 ` Alexey Izbyshev
2024-08-01 16:25 ` Rich Felker
2024-08-01 20:24 ` Alexey Izbyshev
-- strict thread matches above, loose matches on Subject: below --
2022-08-10 13:03 [musl] [PATCH] " Guilherme Janczak
2022-08-18 0:35 ` Rich Felker
2022-08-18 10:11 ` Érico Nogueira
2022-08-18 10:40 ` Alexey Izbyshev
2022-08-18 14:42 ` James Y Knight
2022-08-18 14:54 ` Alexey Izbyshev
2022-08-18 12:31 ` Guilherme Janczak
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=20230901150612.GA4163@brightrain.aerifal.cx \
--to=dalias@libc.org \
--cc=musl@lists.openwall.com \
--cc=ncopa@alpinelinux.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.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
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 NNTP newsgroup(s).