public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Paul Floyd <paulf@free.fr>
To: gcc@gcc.gnu.org
Subject: Re: [RFC] Linux system call builtins
Date: Mon, 8 Apr 2024 20:24:17 +0000	[thread overview]
Message-ID: <941dc5f2-b524-4cd0-a518-ae2ffc9d2488@free.fr> (raw)
In-Reply-To: <2d2f1e405361d2b36dd513e3fabd1fe0@gmail.com>



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


  parent reply	other threads:[~2024-04-08 20:24 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-08  9:19 Matheus Afonso Martins Moreira
2024-04-08  9:58 ` Jonathan Wakely
2024-04-08 11:59   ` Matheus Afonso Martins Moreira
2024-04-08 14:00     ` Jonathan Wakely
2024-04-08 11:24 ` Florian Weimer
2024-04-08 11:44   ` Alexander Monakov
2024-04-08 11:50     ` Florian Weimer
2024-04-08 13:01       ` Alexander Monakov
2024-04-08 13:37   ` Matheus Afonso Martins Moreira
2024-04-08 18:18 ` Paul Iannetta
2024-04-08 18:26   ` Andrew Pinski
2024-04-08 20:01     ` Paul Iannetta
2024-04-08 20:20       ` Paul Koning
2024-04-10  1:48     ` Matheus Afonso Martins Moreira
2024-04-10 13:15       ` Paul Koning
2024-04-10 14:10         ` Matheus Afonso Martins Moreira
2024-04-10  1:26   ` Matheus Afonso Martins Moreira
2024-04-08 20:24 ` Paul Floyd [this message]
2024-04-10  2:19   ` Matheus Afonso Martins Moreira
2024-04-09 11:45 ` Szabolcs Nagy
2024-04-10  2:59   ` Matheus Afonso Martins Moreira
2024-04-10 11:04     ` Szabolcs Nagy
2024-04-10 14:00       ` Matheus Afonso Martins Moreira

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=941dc5f2-b524-4cd0-a518-ae2ffc9d2488@free.fr \
    --to=paulf@free.fr \
    --cc=gcc@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).