manual page distributed with 4.1BSD
authorKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Fri, 10 May 1985 07:42:29 +0000 (23:42 -0800)
committerKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Fri, 10 May 1985 07:42:29 +0000 (23:42 -0800)
SCCS-vsn: lib/libc/sys/syscall.2 4.1

usr/src/lib/libc/sys/syscall.2 [new file with mode: 0644]

diff --git a/usr/src/lib/libc/sys/syscall.2 b/usr/src/lib/libc/sys/syscall.2
new file mode 100644 (file)
index 0000000..4295f24
--- /dev/null
@@ -0,0 +1,71 @@
+.\" Copyright (c) 1980 Regents of the University of California.
+.\" All rights reserved.  The Berkeley software License Agreement
+.\" specifies the terms and conditions for redistribution.
+.\"
+.\"    @(#)syscall.2   4.1 (Berkeley) %G%
+.\"
+.TH SYSCALL 2 
+.UC 4
+.SH NAME
+syscall \- indirect system call
+.SH SYNOPSIS
+.nf
+.BR "syscall(number, r0, r1, arg ...)" \  \  (PDP-11)
+.BR "syscall(number, arg, ...)" \  \  (VAX-11)
+.fi
+.SH DESCRIPTION
+.I Syscall
+performs the system call whose assembly language
+interface has the specified
+.I number,
+register arguments
+.I r0
+and
+.I r1
+(on the PDP-11, regardless of whether the entry point really
+uses them) and further arguments
+.IR arg .
+.PP
+The r0 value of the system call is returned.
+.SH DIAGNOSTICS
+When the C-bit is set,
+.I syscall
+returns \-1 and sets the
+external variable 
+.I errno
+(see
+.IR intro (2)).
+.SH BUGS
+There is no way to simulate system calls
+such as
+.IR pipe (2),
+which return values in register r1.
+.SH "ASSEMBLER (PDP-11)"
+(indir = 0.)
+.br
+.B sys indir; call
+.PP
+The system call at the location
+.I call
+is executed.
+Execution resumes after the
+.I indir
+call.
+.PP
+On the PDP-11, the main purpose of
+.I indir
+is to allow a program to
+store arguments in system calls and execute them
+out of line in the data segment.
+This preserves the purity of the text segment.
+.PP
+If
+.I indir
+is executed indirectly,
+it is a no-op.
+If the instruction at the indirect
+location is not a system call,
+.I indir
+returns error code EINVAL;
+see
+.IR intro (2).