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