Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 1 Sep 2023 16:55:53 +0200
From: Natanael Copa <ncopa@...inelinux.org>
To: Rich Felker <dalias@...c.org>
Cc: musl@...ts.openwall.com
Subject: Re: [PATCH] add close_range() syscall wrapper

On Fri, 1 Sep 2023 09:57:34 -0400
Rich Felker <dalias@...c.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

-nc

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.