1*63508Sbostic.\" Copyright (c) 1980, 1991, 1993 2*63508Sbostic.\" The Regents of the University of California. All rights reserved. 320095Smckusick.\" 447208Scael.\" %sccs.include.redist.man% 520095Smckusick.\" 6*63508Sbostic.\" @(#)syscall.2 8.1 (Berkeley) 06/16/93 747208Scael.\" 847208Scael.Dd 963464Smckusick.Dt SYSCALL 2 1047208Scael.Os BSD 4 1147208Scael.Sh NAME 1263464Smckusick.Nm syscall , 1363464Smckusick.Nm __syscall 1447208Scael.Nd indirect system call 1547208Scael.Sh SYNOPSIS 1657954Sbostic.Fd #include <sys/syscall.h> 1747208Scael.Fd #include <unistd.h> 1847208Scael.Ft int 1963464Smckusick.Fn syscall "int number" "..." 2063447Smckusick.Ft int 2163464Smckusick.Fn __syscall "quad_t number" "..." 2247208Scael.Sh DESCRIPTION 2363464Smckusick.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 3163464Smckusick.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 4863464Smckusick.Nm syscall 4947208Scaelfunction call appeared in 5063464Smckusick.Bx 4.0 . 51