]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - share/doc/psd/05.sysman/0.t
zfs: merge openzfs/zfs@a382e2119
[FreeBSD/FreeBSD.git] / share / doc / psd / 05.sysman / 0.t
1 .\" Copyright (c) 1983, 1993
2 .\"     The Regents of the University of California.  All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\" 3. Neither the name of the University nor the names of its contributors
13 .\"    may be used to endorse or promote products derived from this software
14 .\"    without specific prior written permission.
15 .\"
16 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 .\" SUCH DAMAGE.
27 .\"
28 .if n .ND
29 .TL
30 Berkeley Software Architecture Manual
31 .br
32 4.4BSD Edition
33 .AU
34 William Joy, Robert Fabry,
35 .AU
36 Samuel Leffler, M. Kirk McKusick,
37 .AU
38 Michael Karels
39 .AI
40 Computer Systems Research Group
41 Computer Science Division
42 Department of Electrical Engineering and Computer Science
43 University of California, Berkeley
44 Berkeley, CA  94720
45 .EH 'PSD:5-%''4.4BSD Architecture Manual'
46 .OH '4.4BSD Architecture Manual''PSD:5-%'
47 .AB
48 .FS
49 * UNIX is a trademark of Bell Laboratories.
50 .FE
51 This document summarizes the facilities
52 provided by the 4.4BSD version of the UNIX\|* operating system.
53 It does not attempt to act as a tutorial for use of the system
54 nor does it attempt to explain or justify the design of the
55 system facilities.
56 It gives neither motivation nor implementation details,
57 in favor of brevity.
58 .PP
59 The first section describes the basic kernel functions
60 provided to a UNIX process: process naming and protection,
61 memory management, software interrupts,
62 object references (descriptors), time and statistics functions,
63 and resource controls.
64 These facilities, as well as facilities for
65 bootstrap, shutdown and process accounting,
66 are provided solely by the kernel.
67 .PP
68 The second section describes the standard system
69 abstractions for
70 files and file systems,
71 communication,
72 terminal handling,
73 and process control and debugging.
74 These facilities are implemented by the operating system or by
75 network server processes.
76 .AE
77 .LP
78 .bp
79 .ft B
80 .br
81 .sv 2
82 .ce
83 TABLE OF CONTENTS
84 .ft R
85 .LP
86 .sp 1
87 .nf
88 .B "Introduction."
89 .LP
90 .if t .sp .5v
91 .nf
92 .B "0. Notation and types"
93 .LP
94 .if t .sp .5v
95 .nf
96 .B "1. Kernel primitives"
97 .LP
98 .if t .sp .5v
99 .nf
100 .nf
101 \fB1.1.  Processes and protection\fP
102 1.1.1.  Host and process identifiers
103 1.1.2.  Process creation and termination
104 1.1.3.  User and group ids
105 1.1.4.  Process groups
106 .LP
107 .nf
108 \fB1.2.  Memory management\fP
109 1.2.1.  Text, data and stack
110 1.2.2.  Mapping pages
111 1.2.3.  Page protection control
112 1.2.4.  Giving and getting advice
113 1.2.5.  Protection primitives
114 .LP
115 .if t .sp .5v
116 .nf
117 \fB1.3.  Signals\fP
118 1.3.1.  Overview
119 1.3.2.  Signal types
120 1.3.3.  Signal handlers
121 1.3.4.  Sending signals
122 1.3.5.  Protecting critical sections
123 1.3.6.  Signal stacks
124 .LP
125 .if t .sp .5v
126 .nf
127 \fB1.4.  Timing and statistics\fP
128 1.4.1.  Real time
129 1.4.2.  Interval time
130 .LP
131 .if t .sp .5v
132 .nf
133 \fB1.5.  Descriptors\fP
134 1.5.1.  The reference table
135 1.5.2.  Descriptor properties
136 1.5.3.  Managing descriptor references
137 1.5.4.  Multiplexing requests
138 1.5.5.  Descriptor wrapping
139 .LP
140 .if t .sp .5v
141 .nf
142 \fB1.6.  Resource controls\fP
143 1.6.1.  Process priorities
144 1.6.2.  Resource utilization
145 1.6.3.  Resource limits
146 .LP
147 .if t .sp .5v
148 .nf
149 \fB1.7.  System operation support\fP
150 1.7.1.   Bootstrap operations
151 1.7.2.   Shutdown operations
152 1.7.3.   Accounting
153 .bp
154 .LP
155 .if t .sp .5v
156 .sp 1
157 .nf
158 \fB2.  System facilities\fP
159 .LP
160 .if t .sp .5v
161 .nf
162 \fB2.1.   Generic operations\fP
163 2.1.1.   Read and write
164 2.1.2.   Input/output control
165 2.1.3.   Non-blocking and asynchronous operations
166 .LP
167 .if t .sp .5v
168 .nf
169 \fB2.2.  File system\fP
170 2.2.1   Overview
171 2.2.2.  Naming
172 2.2.3.  Creation and removal
173 2.2.3.1.  Directory creation and removal
174 2.2.3.2.  File creation
175 2.2.3.3.  Creating references to devices
176 2.2.3.4.  Portal creation
177 2.2.3.6.  File, device, and portal removal
178 2.2.4.  Reading and modifying file attributes
179 2.2.5.  Links and renaming
180 2.2.6.  Extension and truncation
181 2.2.7.  Checking accessibility
182 2.2.8.  Locking
183 2.2.9.  Disc quotas
184 .LP
185 .if t .sp .5v
186 .nf
187 \fB2.3.  Interprocess communication\fP
188 2.3.1.   Interprocess communication primitives
189 2.3.1.1.\0   Communication domains
190 2.3.1.2.\0   Socket types and protocols
191 2.3.1.3.\0   Socket creation, naming and service establishment
192 2.3.1.4.\0   Accepting connections
193 2.3.1.5.\0   Making connections
194 2.3.1.6.\0   Sending and receiving data
195 2.3.1.7.\0   Scatter/gather and exchanging access rights
196 2.3.1.8.\0   Using read and write with sockets
197 2.3.1.9.\0   Shutting down halves of full-duplex connections
198 2.3.1.10.\0  Socket and protocol options
199 2.3.2.   UNIX domain
200 2.3.2.1.    Types of sockets
201 2.3.2.2.    Naming
202 2.3.2.3.    Access rights transmission
203 2.3.3.   INTERNET domain
204 2.3.3.1.    Socket types and protocols
205 2.3.3.2.    Socket naming
206 2.3.3.3.    Access rights transmission
207 2.3.3.4.    Raw access
208 .LP
209 .if t .sp .5v
210 .nf
211 \fB2.4.  Terminals and devices\fP
212 2.4.1.   Terminals
213 2.4.1.1.    Terminal input
214 2.4.1.1.1     Input modes
215 2.4.1.1.2     Interrupt characters
216 2.4.1.1.3     Line editing
217 2.4.1.2.    Terminal output
218 2.4.1.3.    Terminal control operations
219 2.4.1.4.    Terminal hardware support
220 2.4.2.   Structured devices
221 2.4.3.   Unstructured devices
222 .LP
223 .if t .sp .5v
224 .nf
225 \fB2.5.  Process control and debugging\fP
226 .LP
227 .if t .sp .5v
228 .nf
229 \fBI.  Summary of facilities\fP
230 .LP
231 .de sh
232 .ds RH \\$1
233 .bp
234 .NH \\*(ss
235 \s+2\\$1\s0
236 .PP
237 .PP
238 ..
239 .bp
240 .ds ss 1
241 .de _d
242 .if t .ta .6i 2.1i 2.6i
243 .\" 2.94 went to 2.6, 3.64 to 3.30
244 .if n .ta .84i 2.6i 3.30i
245 ..
246 .de _f
247 .if t .ta .5i 1.25i 2.5i 3.5i
248 .\" 3.5i went to 3.8i
249 .if n .ta .7i 1.75i 3.8i 4.8i
250 ..
251 .nr H1 -1
252 .sh "Notation and types
253 .PP
254 The notation used to describe system calls is a variant of a
255 C language call, consisting of a prototype call followed by
256 declaration of parameters and results.
257 An additional keyword \fBresult\fP, not part of the normal C language,
258 is used to indicate which of the declared entities receive results.
259 As an example, consider the \fIread\fP call, as described in
260 section 2.1:
261 .DS
262 cc = read(fd, buf, nbytes);
263 result int cc; int fd; result char *buf; int nbytes;
264 .DE
265 The first line shows how the \fIread\fP routine is called, with
266 three parameters.
267 As shown on the second line \fIcc\fP is an integer and \fIread\fP also
268 returns information in the parameter \fIbuf\fP.
269 .PP
270 Description of all error conditions arising from each system call
271 is not provided here; they appear in the programmer's manual.
272 In particular, when accessed from the C language,
273 many calls return a characteristic \-1 value
274 when an error occurs, returning the error code in the global variable
275 \fIerrno\fP.
276 Other languages may present errors in different ways.
277 .PP
278 A number of system standard types are defined in the include file
279 .I <sys/types.h>
280 and used in the specifications here and in many C programs.
281 These include \fBcaddr_t\fP giving a memory address (typically as
282 a character pointer), 
283 \fBoff_t\fP giving a file offset (typically as a long integer),
284 and a set of unsigned types \fBu_char\fP, \fBu_short\fP, \fBu_int\fP
285 and \fBu_long\fP, shorthand names for \fBunsigned char\fP, \fBunsigned
286 short\fP, etc.