147208Scael.\" Copyright (c) 1980, 1991 Regents of the University of California. 247208Scael.\" All rights reserved. 320095Smckusick.\" 447208Scael.\" %sccs.include.redist.man% 520095Smckusick.\" 6*63464Smckusick.\" @(#)syscall.2 6.7 (Berkeley) 06/16/93 747208Scael.\" 847208Scael.Dd 9*63464Smckusick.Dt SYSCALL 2 1047208Scael.Os BSD 4 1147208Scael.Sh NAME 12*63464Smckusick.Nm syscall , 13*63464Smckusick.Nm __syscall 1447208Scael.Nd indirect system call 1547208Scael.Sh SYNOPSIS 1657954Sbostic.Fd #include <sys/syscall.h> 1747208Scael.Fd #include <unistd.h> 1847208Scael.Ft int 19*63464Smckusick.Fn syscall "int number" "..." 2063447Smckusick.Ft int 21*63464Smckusick.Fn __syscall "quad_t number" "..." 2247208Scael.Sh DESCRIPTION 23*63464Smckusick.Fn Syscall 2420095Smckusickperforms the system call whose assembly language 2520095Smckusickinterface has the specified 2647208Scael.Fa number 2747208Scaelwith the specified arguments. 2827109SmckusickSymbolic constants for system calls can be found in the header file 2957954Sbostic.Ao Pa sys/syscall.h Ac . 3063447SmckusickThe 31*63464Smckusick.Nm __syscall 3263447Smckusickform should be used when one or more of the parameters is a 3363447Smckusick64-bit argument to ensure that argument alignment is correct. 3463447SmckusickThis system call is useful for testing new system calls that 3563447Smckusickdo not have entries in the C library. 3647208Scael.Sh RETURN VALUES 3763447SmckusickThe return values are defined by the system call being invoked. 3863447SmckusickIn general, a 0 return value indicates success. 3963447SmckusickA -1 return value indicates an error, 4063447Smckusickand an error code is stored in 4163447Smckusick.Va errno . 4247208Scael.Sh BUGS 4363447SmckusickThere is no way to simulate system calls that have multiple return values 4420095Smckusicksuch as 4547208Scael.Xr pipe 2 . 4647208Scael.Sh HISTORY 4747208ScaelThe 48*63464Smckusick.Nm syscall 4947208Scaelfunction call appeared in 50*63464Smckusick.Bx 4.0 . 51