4.4BSD snapshot (revision 8.1); add 1993 to copyright
[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 8.1 (Berkeley) %G%
.\"
.Dd
.Dt INDIR 2
.Os BSD 4
.Sh NAME
.Nm indir ,
.Nm __indir
.Nd indirect system call
.Sh SYNOPSIS
.Fd #include <sys/syscall.h>
.Fd #include <unistd.h>
.Ft int
.Fn indir "int number" "..."
.Ft int
.Fn __indir "quad_t number" "..."
.Sh DESCRIPTION
.Fn Indir
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 __indir
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 indir
function call appeared in
.Bx 4.0
under the name
.Nm syscall .
Due to an oversight its name changed to
.Nm indir
in
.Bx 4.4 .