.\" Copyright (c) 1983, 1993
.\" The Regents of the University of California. All rights reserved.
.\" %sccs.include.redist.roff%
.\" @(#)0.t 8.1 (Berkeley) %G%
Berkeley Software Architecture Manual
William Joy, Robert Fabry,
Samuel Leffler, M. Kirk McKusick,
Computer Systems Research Group
Computer Science Division
Department of Electrical Engineering and Computer Science
University of California, Berkeley
.EH 'PSD:5-%''4.4BSD Architecture Manual'
.OH '4.4BSD Architecture Manual''PSD:5-%'
* UNIX is a trademark of Bell Laboratories.
This document summarizes the facilities
provided by the 4.4BSD version of the UNIX\|* operating system.
It does not attempt to act as a tutorial for use of the system
nor does it attempt to explain or justify the design of the
It gives neither motivation nor implementation details,
The first section describes the basic kernel functions
provided to a UNIX process: process naming and protection,
memory management, software interrupts,
object references (descriptors), time and statistics functions,
These facilities, as well as facilities for
bootstrap, shutdown and process accounting,
are provided solely by the kernel.
The second section describes the standard system
and process control and debugging.
These facilities are implemented by the operating system or by
network server processes.
.B "0. Notation and types"
.B "1. Kernel primitives"
\fB1.1. Processes and protection\fP
1.1.1. Host and process identifiers
1.1.2. Process creation and termination
1.1.3. User and group ids
\fB1.2. Memory management\fP
1.2.1. Text, data and stack
1.2.3. Page protection control
1.2.4. Giving and getting advice
1.2.5. Protection primitives
1.3.5. Protecting critical sections
\fB1.4. Timing and statistics\fP
1.5.1. The reference table
1.5.2. Descriptor properties
1.5.3. Managing descriptor references
1.5.4. Multiplexing requests
1.5.5. Descriptor wrapping
\fB1.6. Resource controls\fP
1.6.1. Process priorities
1.6.2. Resource utilization
\fB1.7. System operation support\fP
1.7.1. Bootstrap operations
1.7.2. Shutdown operations
\fB2. System facilities\fP
\fB2.1. Generic operations\fP
2.1.2. Input/output control
2.1.3. Non-blocking and asynchronous operations
2.2.3. Creation and removal
2.2.3.1. Directory creation and removal
2.2.3.3. Creating references to devices
2.2.3.6. File, device, and portal removal
2.2.4. Reading and modifying file attributes
2.2.5. Links and renaming
2.2.6. Extension and truncation
2.2.7. Checking accessibility
\fB2.3. Interprocess communication\fP
2.3.1. Interprocess communication primitives
2.3.1.1.\0 Communication domains
2.3.1.2.\0 Socket types and protocols
2.3.1.3.\0 Socket creation, naming and service establishment
2.3.1.4.\0 Accepting connections
2.3.1.5.\0 Making connections
2.3.1.6.\0 Sending and receiving data
2.3.1.7.\0 Scatter/gather and exchanging access rights
2.3.1.8.\0 Using read and write with sockets
2.3.1.9.\0 Shutting down halves of full-duplex connections
2.3.1.10.\0 Socket and protocol options
2.3.2.1. Types of sockets
2.3.2.3. Access rights transmission
2.3.3.1. Socket types and protocols
2.3.3.3. Access rights transmission
\fB2.4. Terminals and devices\fP
2.4.1.1.2 Interrupt characters
2.4.1.3. Terminal control operations
2.4.1.4. Terminal hardware support
2.4.2. Structured devices
2.4.3. Unstructured devices
\fB2.5. Process control and debugging\fP
\fBI. Summary of facilities\fP
.\" 2.94 went to 2.6, 3.64 to 3.30
.if n .ta .84i 2.6i 3.30i
.if t .ta .5i 1.25i 2.5i 3.5i
.if n .ta .7i 1.75i 3.8i 4.8i
The notation used to describe system calls is a variant of a
C language call, consisting of a prototype call followed by
declaration of parameters and results.
An additional keyword \fBresult\fP, not part of the normal C language,
is used to indicate which of the declared entities receive results.
As an example, consider the \fIread\fP call, as described in
cc = read(fd, buf, nbytes);
result int cc; int fd; result char *buf; int nbytes;
The first line shows how the \fIread\fP routine is called, with
As shown on the second line \fIcc\fP is an integer and \fIread\fP also
returns information in the parameter \fIbuf\fP.
Description of all error conditions arising from each system call
is not provided here; they appear in the programmer's manual.
In particular, when accessed from the C language,
many calls return a characteristic \-1 value
when an error occurs, returning the error code in the global variable
Other languages may present errors in different ways.
A number of system standard types are defined in the include file
and used in the specifications here and in many C programs.
These include \fBcaddr_t\fP giving a memory address (typically as
\fBoff_t\fP giving a file offset (typically as a long integer),
and a set of unsigned types \fBu_char\fP, \fBu_short\fP, \fBu_int\fP
and \fBu_long\fP, shorthand names for \fBunsigned char\fP, \fBunsigned