From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from brightrain.aerifal.cx (brightrain.aerifal.cx [IPv6:2001:19f0:5:42::1]) by sourceware.org (Postfix) with ESMTPS id 2DC323858D32 for ; Mon, 12 Feb 2024 14:44:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2DC323858D32 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=libc.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=aerifal.cx ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 2DC323858D32 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:19f0:5:42::1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707749070; cv=none; b=pHXwuSxAUFUij6T/ItavXSSMqOvgkJPzvfye/bAV/k4KgHAxePYOa3PtmecA+1GFlf+689AdO5SARaOcbwwOH3AgrUsDY3OOlcVy9GhQOJZFf/e0IsxFg67059ZhNOjy3xtIdiJxcg3lMoXQ8HPq3k3fRpI49oYPeRC0gyc2AOA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707749070; c=relaxed/simple; bh=IfKOA2eFgOmsAwI7M+498GJwtKmaZJXR8rPLP1WmZ0c=; h=Date:From:To:Subject:Message-ID:MIME-Version; b=pJdyDjXm+kCcsAKef2IKk1EZOtcte2ktVp/rskq2HQoYrDGaQZLv1nRATkiU+MAaCZOzpmhws9XeJk3Es15wrsms/O1ZzkJM6/60l1n8AuXAYK1/JqRGR2+wV5/M631E6oNNVJXjvsjaprixBXOizZ/QWF9LCO6IpXA0ZCE+Nxg= ARC-Authentication-Results: i=1; server2.sourceware.org Date: Mon, 12 Feb 2024 09:44:39 -0500 From: Rich Felker To: Florian Weimer Cc: Askar Safin , libc-alpha@sourceware.org, adhemerval.zanella@linaro.org, carlos@redhat.com Subject: Re: [PATCH v2] Add public function syscall_no_errno Message-ID: <20240212144439.GO22081@brightrain.aerifal.cx> References: <20240208152224.11031-2-safinaskar@zohomail.com> <87wmr9ahfv.fsf@oldenburg3.str.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87wmr9ahfv.fsf@oldenburg3.str.redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Mon, Feb 12, 2024 at 03:24:52PM +0100, Florian Weimer wrote: > * Askar Safin: > > > +@code{syscall_no_errno} is Linux-specific GNU extension. It does the same > > +as @code{syscall}, but does not interpret return value, returned by Linux > > +kernel, and doesn't set @code{errno}. This makes @code{syscall_no_errno} > > +suitable for performing Linux syscalls, which never fail, such as > > +@code{SYS_getuid}. > > Are there really any system calls which return a value in the range > -4095 to -1, and it's still considered a success? Yes, there are a very small number of such syscalls -- getuid and getgid are the only relevant ones AFAICT -- but the author of this proposal is missing the point. They want to avoid using libc, but then have a libc function to make their raw syscalls for them, rather than just doing that themselves. And apparently this function is supposed to have an undocumented contract that you can call it from contexts where calling other libc functions might not be valid..? Or not? It was never really clarified. They also seem to be under the mistaken impression that you can just add arbitrary pet functions to libc as long as you follow some procedures for doing it the right way, rather than understanding that the maintainer's job is to say no, and that functions don't go in libc unless there's some sort of consensus that they belong there. Rich