well, the name is back to syscall
[unix-history] / usr / src / lib / libc / sys / syscall.2
.\" Copyright (c) 1980, 1991 Regents of the University of California.
.\" All rights reserved.
.\"
.\" %sccs.include.redist.man%
.\"
.\" @(#)syscall.2 6.7 (Berkeley) %G%
.\"
.Dd
.Dt SYSCALL 2
.Os BSD 4
.Sh NAME
.Nm syscall ,
.Nm __syscall
.Nd indirect system call
.Sh SYNOPSIS
.Fd #include <sys/syscall.h>
.Fd #include <unistd.h>
.Ft int
.Fn syscall "int number" "..."
.Ft int
.Fn __syscall "quad_t number" "..."
.Sh DESCRIPTION
.Fn Syscall
performs the system call whose assembly language
interface has the specified
.Fa number
with the specified arguments.
Symbolic constants for system calls can be found in the header file
.Ao Pa sys/syscall.h Ac .
The
.Nm __syscall
form should be used when one or more of the parameters is a
64-bit argument to ensure that argument alignment is correct.
This system call is useful for testing new system calls that
do not have entries in the C library.
.Sh RETURN VALUES
The return values are defined by the system call being invoked.
In general, a 0 return value indicates success.
A -1 return value indicates an error,
and an error code is stored in
.Va errno .
.Sh BUGS
There is no way to simulate system calls that have multiple return values
such as
.Xr pipe 2 .
.Sh HISTORY
The
.Nm syscall
function call appeared in
.Bx 4.0 .