xref: /original-bsd/lib/libc/sys/syscall.2 (revision 6783872e)
1.\" Copyright (c) 1980, 1991 Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
6.\"     @(#)syscall.2	6.4 (Berkeley) 02/12/93
7.\"
8.Dd
9.Dt SYSCALL 2
10.Os BSD 4
11.Sh NAME
12.Nm syscall
13.Nd indirect system call
14.Sh SYNOPSIS
15.Fd #include <sys/syscall.h>
16.Fd #include <unistd.h>
17.Ft int
18.Fn syscall "int number" "..."
19.Sh DESCRIPTION
20.Fn Syscall
21performs the system call whose assembly language
22interface has the specified
23.Fa number
24with the specified arguments.
25Symbolic constants for system calls can be found in the header file
26.Ao Pa sys/syscall.h Ac .
27.Pp
28.Sh RETURN VALUES
29The r0 value of the system call is returned.
30When the C-bit is set,
31.Fn syscall
32returns -1 and sets the
33external variable
34.Va errno
35(see
36.Xr intro 2 ) .
37.Sh BUGS
38There is no way to simulate system calls
39such as
40.Xr pipe 2 .
41.Sh HISTORY
42The
43.Nm
44function call appeared in
45.Bx 4.0 .
46