From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 4859 invoked from network); 1 Sep 2023 14:56:14 -0000 Received: from second.openwall.net (193.110.157.125) by inbox.vuxu.org with ESMTPUTF8; 1 Sep 2023 14:56:14 -0000 Received: (qmail 3948 invoked by uid 550); 1 Sep 2023 14:56:10 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 3913 invoked from network); 1 Sep 2023 14:56:10 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alpinelinux.org; s=smtp; t=1693580157; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kNeBX5rT8x269lgVyTceBuIDO55jGH4HVob6imwgf24=; b=S3kGJ/bsYAc+KTwHUSH6zmeWLSLHgyG9c8xUYJrcw+nPtanjPGKfYaQ+j6JuMIjTkK+aLH iwgNXKVLWdd/DX7eEHC3iam+NtGet/Mysac4sSqZhgAxaFGuVlGPKtD9HdCEPb/hp4edH2 u2/dRsGWL+QCJVOo4DfD41JtYsYipPA= Date: Fri, 1 Sep 2023 16:55:53 +0200 From: Natanael Copa To: Rich Felker Cc: musl@lists.openwall.com Message-ID: <20230901165553.3755a1c7@ncopa-desktop.lan> In-Reply-To: <20230901135733.GZ4163@brightrain.aerifal.cx> References: <20230901080224.10889-1-ncopa@alpinelinux.org> <20230901135733.GZ4163@brightrain.aerifal.cx> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-alpine-linux-musl) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [musl] [PATCH] add close_range() syscall wrapper On Fri, 1 Sep 2023 09:57:34 -0400 Rich Felker 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