1 .\" $NetBSD: 0.t,v 1.3 2003/08/07 10:30:48 agc Exp $
3 .\" Copyright (c) 1983, 1993, 1994
4 .\" The Regents of the University of California. All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
14 .\" 3. Neither the name of the University nor the names of its contributors
15 .\" may be used to endorse or promote products derived from this software
16 .\" without specific prior written permission.
18 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" @(#)0.t 8.3 (Berkeley) 5/26/94
34 Berkeley Software Architecture Manual
38 M. Kirk McKusick, Michael Karels
40 Samuel Leffler, William Joy
44 Computer Systems Research Group
45 Computer Science Division
46 Department of Electrical Engineering and Computer Science
47 University of California, Berkeley
49 .EH 'PSD:5-%''4.4BSD Architecture Manual'
50 .OH '4.4BSD Architecture Manual''PSD:5-%'
52 This document summarizes the system calls
53 provided by the 4.4BSD operating system.
54 It does not attempt to act as a tutorial for use of the system,
55 nor does it attempt to explain or justify the design of the
57 It gives neither motivation nor implementation details,
60 The first section describes the basic kernel functions
61 provided to a process: process naming and protection,
62 memory management, software interrupts,
63 time and statistics functions,
64 object references (descriptors),
65 and resource controls.
66 These facilities, as well as facilities for
67 bootstrap, shutdown and process accounting,
68 are provided solely by the kernel.
70 The second section describes the standard system
72 files and filesystems,
75 and process control and debugging.
76 These facilities are implemented by the operating system or by
77 network server processes.
83 .sy echo >>toc '.L\\$1 "\\$2" \\n%'
100 .sy echo >>toc '.Nm \\$1 \\$2 "\\$3'
102 .Sh 0 "Notation and Types
104 The notation used to describe system calls is a variant of a
105 C language function call, consisting of a prototype call followed by
106 the declaration of parameters and results.
107 An additional keyword \fBresult\fP, not part of the normal C language,
108 is used to indicate which of the declared entities receive results.
109 As an example, consider the \fIread\fP call, as described in
113 cc = read(fd, buf, nbytes);
114 result ssize_t cc; int fd; result void *buf; size_t nbytes;
116 The first line shows how the \fIread\fP routine is called, with
118 As shown on the second line,
119 the return value \fIcc\fP is a size_t and \fIread\fP
120 also returns information in the parameter \fIbuf\fP.
122 The descriptions of error conditions arising from each system call
123 are not provided here; they appear in section
125 of the Programmer's Reference Manual.
126 In particular, when accessed from the C language,
127 many calls return a characteristic \-1 value
128 when an error occurs, returning the error code in the global variable
130 Other languages may present errors in different ways.
132 A number of system standard types are defined by the include file
134 and used in the specifications here and in many C programs.
141 caddr_t char * /* a memory address */
142 clock_t unsigned long /* count of CLK_TCK's */
143 gid_t unsigned long /* group ID */
144 int16_t short /* 16-bit integer */
145 int32_t int /* 32-bit integer */
146 int64_t long long /* 64-bit integer */
147 int8_t signed char /* 8-bit integer */
148 mode_t unsigned short /* file permissions */
149 off_t quad_t /* file offset */
150 pid_t long /* process ID */
153 size_t unsigned int /* count of bytes */
154 ssize_t int /* signed size_t */
155 time_t long /* seconds since the Epoch */
159 u_quad_t unsigned long long
160 u_short unsigned short
161 uid_t unsigned long /* user ID */
162 uint unsigned int /* System V compatibility */
163 uint16_t unsigned short /* unsigned 16-bit integer */
164 uint32_t unsigned int /* unsigned 32-bit integer */
165 uint64_t unsigned long long /* unsigned 64-bit integer */
166 uint8_t unsigned char /* unsigned 8-bit integer */
167 ushort unsigned short /* System V compatibility */