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

Reply via email to