From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp6-g21.free.fr (smtp6-g21.free.fr [212.27.42.6]) by sourceware.org (Postfix) with ESMTPS id 7FDB3385840B for ; Mon, 8 Apr 2024 20:24:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7FDB3385840B Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=free.fr Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=free.fr ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 7FDB3385840B Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=212.27.42.6 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712607863; cv=none; b=L4RmNZZxZw3mwU/a8oBhxdLKWipt11gKlJ2UEDFDAuWUt4RioBeG3zqez3WfCEiXCZplF3F7IPSrQPZEFkVJo5OyALX69CNMIOatouppsGwn9jckZZxyeNAnGJ7m8SWibq7MF5Wim7rt/fcakQKrRjr+N+FLdxBF8RmYGmtAOCw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712607863; c=relaxed/simple; bh=3GUwI7AFQMQ0TL66IwxlJWwzzRsIACRcfmZcNll4XuE=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=nVePdaqnkjPoGtGl9veTs8DbHyK+pOtBBNxewSWtrivDBs+1JdrNVUPnp1tzOpWqOINvBSp1pdBPzuHZfnZB/TrlLEbBYShEznAcb2GzQCoCihHUrdSL0MO6nzUqE8PywNMknntUE+sAc4be5Q+UH8zed6WnKt6Tlioqk1NBzY8= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from [IPV6:2a01:cb15:8010:2f00:1aa9:5ff:fe16:2efb] (unknown [IPv6:2a01:cb15:8010:2f00:1aa9:5ff:fe16:2efb]) (Authenticated sender: paulf@free.fr) by smtp6-g21.free.fr (Postfix) with ESMTPSA id 08DEE78032A for ; Mon, 8 Apr 2024 22:24:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=free.fr; s=smtp-20201208; t=1712607858; bh=3GUwI7AFQMQ0TL66IwxlJWwzzRsIACRcfmZcNll4XuE=; h=Date:Subject:To:References:From:In-Reply-To:From; b=r2+1KJFtUFDbuM2rnmRCPx9f66N4qCL7SOWQv77DIBJgxAPPWp8aQ2uX1NJ2b6GoZ m+ZT/MPOzfJCvdAxoKsVXKzSe0kk6tvEnlzuq1hplP+DLX2hitxV7fYCRyZpxTfcJ0 UC2LTEUDMW9wj6jFLiSMT18BkEIcM/0hTNv2JL7r2NezfwEHw/ZjdKx2Pt26LNf2fA t4vl4AHQ98n2DWYwj30JZVfz898tUyiiF4cDnSe5X9hPyUpDXSk4qqGa/umvBkLeDH goxTD6exzNnlvMAtsTbidpFQI6KKoc111X2sMWq7CaupZrI1AttAP5wfTz9lAGdypM uQBYfsJKAYTog== Message-ID: <941dc5f2-b524-4cd0-a518-ae2ffc9d2488@free.fr> Date: Mon, 8 Apr 2024 20:24:17 +0000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC] Linux system call builtins To: gcc@gcc.gnu.org References: <2d2f1e405361d2b36dd513e3fabd1fe0@gmail.com> Content-Language: en-US From: Paul Floyd In-Reply-To: <2d2f1e405361d2b36dd513e3fabd1fe0@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,JMQ_SPF_NEUTRAL,KAM_SHORT,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,TXREP 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 08-04-24 09:19, Matheus Afonso Martins Moreira via Gcc wrote: > + It's becoming common > > Despite being specific to the Linux kernel, > support for it is showing up in other systems. > FreeBSD implements limited support[4] for Linux ABIs. > Windows Subsystem for Linux started out[5] similarly, > as an implementation of this system call ABI. > Apparently it's becoming something of a lingua franca. > Maybe one day Linux programs will actually become > portable by virtue of this stable binary interface. I don't really buy your portability argument. FreeBSD implements this as a syscall (two actually). syscall 0: int syscall(int number, ...); syscall 198: int __syscall(int64_t number, ...); (I've never seen the second one used in anger, it's supposed to be for systems that have unusual argument padding). The argument shuffling gets done in the kernel, not libc. In fact FreeBSD 15 just moved all syscall wrappers to a separate library, libsys, so it's there now. Over in OpenBSD they are going to removing 'syscall' from libc. https://lwn.net/Articles/949078/ From what I've seen it has also been removed by Apple. Whilst you aren't proposing the same thing, I see systems making it more difficult for code to make syscalls, not easier. I also think that this could be misleading. There are sometimes subtle differences between the syscall interface and the interface exported by libc. A+ Paul