[PATCH v2] manual: describe syscall numbers not supported via syscall()

Yury Khrustalev yury.khrustalev@arm.com
Wed Sep 24 09:20:42 GMT 2025


On Tue, Sep 23, 2025 at 12:01:13PM -0300, Adhemerval Zanella Netto wrote:
> 
> On 16/09/25 06:00, Yury Khrustalev wrote:
> > The syscall() function allows to make system calls directly, however,
> > in the case of system calls that affect internal state of process or
> > thread, the caller would have to take care of extensive setup necessary
> > for the internals of Glibc to work correctly in the child threads. This
> > may make using syscall() with these syscall numbers impractical and
> > prone to undefined behaviour.
> > 
> > ...
> >
> > +Using @code{syscall} with system calls that affect the internal state of
> > +process of thread will likely result in undefined behavior. For this reason,
> > +at least the following system call numbers are not supported when invoked via
> > +@code{syscall}: @code{SYS_clone}, @code{SYS_clone2}, @code{SYS_clone3},
> > +@code{SYS_rt_sigreturn}, @code{SYS_sigreturn}, @code{SYS_vfork}.
> 
> Some ABIs also support __NR_fork, but I am not sure if it is worth to mention
> here.

The list is not intended to be exhaustive, so it should probably be OK
to leave fork out. If this is OK, I'll push this patch as per v2.

Thanks,
Yury



More information about the Libc-alpha mailing list