1.\" Copyright (c) 1980, 1991, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" %sccs.include.redist.man% 5.\" 6.\" @(#)syscall.2 8.1 (Berkeley) 06/16/93 7.\" 8.Dd 9.Dt SYSCALL 2 10.Os BSD 4 11.Sh NAME 12.Nm syscall , 13.Nm __syscall 14.Nd indirect system call 15.Sh SYNOPSIS 16.Fd #include <sys/syscall.h> 17.Fd #include <unistd.h> 18.Ft int 19.Fn syscall "int number" "..." 20.Ft int 21.Fn __syscall "quad_t number" "..." 22.Sh DESCRIPTION 23.Fn Syscall 24performs the system call whose assembly language 25interface has the specified 26.Fa number 27with the specified arguments. 28Symbolic constants for system calls can be found in the header file 29.Ao Pa sys/syscall.h Ac . 30The 31.Nm __syscall 32form should be used when one or more of the parameters is a 3364-bit argument to ensure that argument alignment is correct. 34This system call is useful for testing new system calls that 35do not have entries in the C library. 36.Sh RETURN VALUES 37The return values are defined by the system call being invoked. 38In general, a 0 return value indicates success. 39A -1 return value indicates an error, 40and an error code is stored in 41.Va errno . 42.Sh BUGS 43There is no way to simulate system calls that have multiple return values 44such as 45.Xr pipe 2 . 46.Sh HISTORY 47The 48.Nm syscall 49function call appeared in 50.Bx 4.0 . 51