summaryrefslogtreecommitdiff
path: root/usr/src/man/man3ucb/syscall.3ucb
blob: f7438d3484db0db5ea4fca0e41724019bcc2ee7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
'\" te
.\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
.\" Copyright (c) 1980 Regents of the University of California.  All rights reserved.  The Berkeley software License Agreement specifies the terms and conditions for redistribution.
.TH SYSCALL 3UCB "Oct 30, 2007"
.SH NAME
syscall \- indirect system call
.SH SYNOPSIS
.LP
.nf
\fB/usr/ucb/cc\fR [ \fIflag\fR ... ] \fIfile\fR ...
#include <sys/syscall.h>

\fBint\fR \fBsyscall\fR(\fInumber\fR, \fIarg\fR, \fI\&...\fR)
\fBint\fR \fInumber\fR;
.fi

.SH DESCRIPTION
.sp
.LP
\fBsyscall()\fR performs the function whose assembly language interface has the
specified \fInumber\fR, and arguments \fIarg .\|.\|.\fR. Symbolic constants for
functions can be found in the header \fB<sys/syscall.h>\fR.
.SH RETURN VALUES
.sp
.LP
On error \fBsyscall()\fR returns \(mi1 and sets the external variable
\fBerrno\fR (see \fBIntro\fR(2)).
.SH FILES
.sp
.LP
\fB<sys/syscall.h>\fR
.SH SEE ALSO
.sp
.LP
\fBIntro\fR(2), \fBpipe\fR(2)
.SH NOTES
.sp
.LP
Use of these interfaces should be restricted to only applications written on
BSD platforms.  Use of these interfaces with any of the system libraries or in
multi-thread applications is unsupported.
.SH WARNINGS
.sp
.LP
There is no way to use \fBsyscall()\fR to call functions such as \fBpipe\fR(2)
which return values that do not fit into one hardware register.
.sp
.LP
Since many system calls are implemented as library wrappers around traps to the
kernel, these calls may not behave as documented when called from
\fBsyscall()\fR, which bypasses these wrappers. For these reasons, using
\fBsyscall()\fR is not recommended.