BSD 3 development
[unix-history] / usr / man / man2 / indir.2
CommitLineData
e6817382
BJ
1.TH INDIR 2
2.SH NAME
3indir, syscall \- indirect system call
4.SH SYNOPSIS
5.BR "syscall(number, r0, r1, arg ...)" \ \ (PDP-11)
6.br
7.BR "syscall(number, arg, ...)" \ \ (VAX-11)
8.SH DESCRIPTION
9.I Syscall
10performs the system call whose assembly language
11interface has the specified
12.I number,
13register arguments
14.I r0
15and
16.I r1
17(on the PDP-11, regardless of whether the entry point really
18uses them) and further arguments
19.IR arg .
20.PP
21The r0 value of the system call is returned.
22.SH DIAGNOSTICS
23When the C-bit is set,
24.I syscall
25returns \-1 and sets the
26external variable
27.I errno
28(see
29.IR intro (2)).
30.SH BUGS
31There is no way to simulate system calls
32such as
33.IR pipe (2),
34which return values in register r1.
35.SH "ASSEMBLER (PDP-11)"
36(indir = 0.)
37.br
38.B sys indir; call
39.PP
40The system call at the location
41.I call
42is executed.
43Execution resumes after the
44.I indir
45call.
46.PP
47On the PDP-11, the main purpose of
48.I indir
49is to allow a program to
50store arguments in system calls and execute them
51out of line in the data segment.
52This preserves the purity of the text segment.
53.PP
54If
55.I indir
56is executed indirectly,
57it is a no-op.
58If the instruction at the indirect
59location is not a system call,
60.I indir
61returns error code EINVAL;
62see
63.IR intro (2).