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.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,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 4789 invoked from network); 17 Jul 2020 21:37:43 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 17 Jul 2020 21:37:43 -0000 Received: (qmail 7756 invoked by uid 550); 17 Jul 2020 21:37:41 -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 7732 invoked from network); 17 Jul 2020 21:37:40 -0000 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yqxmail.com; s=dkim; t=1595021848; bh=RlueXR6CFxCkZ5Uqt91LuDd0TpS4zuI9Z6chApZq29Y=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=pRYd4Ziw94MWaiideqa6xcUHE/DL/tz7jUn6Tggta0U3B0lYItMXbleC9gKkFMTHK Sq+UZmjDJW6LPcPuwb0wf8DDwWvdE0PQEcWtZcVWYVLiOhxJOFGrFnS6ap84TAbQzI HsednlOxcyDd6FEl/3qTp7Der9zObjbfBpZ51n2GURZu7A+8daTRL0acr1MQqdcofb aAZWpmn/TywU4Y8k+r4l5+ApU25ji4sf1yC5JoSpX0hab+KmSydoK5Nk8HeCXXsGK9 L++fx6pi+3OWtFelDNc3j2vpRI4xbwS4LzOMy6ULVoT40ly7j2ux3lUtey4RUGVgV8 w5PVtr/Oy0QTQ== Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 17 Jul 2020 14:37:27 -0700 From: Hydro Flask To: musl@lists.openwall.com Cc: Carlos O'Donell , Florian Weimer In-Reply-To: <20200717211933.GI14669@brightrain.aerifal.cx> References: <04c05d65470b5c94808481eaf724cc5d@yqxmail.com> <87pn8uwu18.fsf@oldenburg2.str.redhat.com> <4095a8a7f75becee9bcfc71024e43802@yqxmail.com> <20200717092111.GA3210874@port70.net> <7a8de0d4-d9f7-6ab2-1aec-713597b47ca8@redhat.com> <03e28c2e6beb406c3a1ce3bfa99c67eb@yqxmail.com> <20200717211050.GB3210874@port70.net> <20200717211933.GI14669@brightrain.aerifal.cx> Message-ID: <449cc77dc2bc153de7a2633ee8613b42@yqxmail.com> Subject: Re: [musl] Idea: futex() system call entry point On 2020-07-17 14:19, Rich Felker wrote: > On Fri, Jul 17, 2020 at 11:10:50PM +0200, Szabolcs Nagy wrote: >> * Hydro Flask [2020-07-17 11:57:36 -0700]: >> > In general the user should ensure that cancellation is disabled one way or >> > another when the call is called from the signal handler, or that the call is >> > being done in a AC-safe region. There are a variety of ways to do this as >> > discussed in POSIX. >> >> it's possible to do this, but it's a rare requirement. >> >> futex is not a nice syscall to expose in c. >> >> currently there is disagreement about how to expose it: >> directly the linux api (which is variadic and not very >> typesafe) or separate calls for the useful operations >> (futex_wait, futex_wake, etc but the exact c api is >> less clear then). >> >> because of new time_t abi on 32bit targets, the timeout >> argument to futex is another reason to expose it in c >> instead of allowing users to use it via syscall (if they >> use the libc timespec type with the raw syscall that can >> be broken). >> >> in any case it's better to discuss this on libc-alpha >> since musl and glibc must expose the same api for it >> to be useful and it is harder to get this into glibc. > > CC'ing libc-coord would also be appropriate for this, I think, even if > it is Linux-only and not relevant to the BSD etc folks there. > > I do want to expose futex function but I don't want to end up with > something gratuitously incompatible/conflicting with what glibc ends > up doing. I didn't realize this discussion was more complex. Non-Linux/Glibc is not my use case so I would have proposed "musl_futex()" to make things move quicker but not if adding non-standard calls is something Linux libcs avoid without consensus. Maybe a less complex suggestion is to expose a syscall_cp() function, so you can get cancellation point functionality for any system call. I actually quite like that option. How does that sound?