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