📄 0.t
字号:
.\" Copyright (c) 1983, 1993.\" The Regents of the University of California. All rights reserved..\".\" Redistribution and use in source and binary forms, with or without.\" modification, are permitted provided that the following conditions.\" are met:.\" 1. Redistributions of source code must retain the above copyright.\" notice, this list of conditions and the following disclaimer..\" 2. Redistributions in binary form must reproduce the above copyright.\" notice, this list of conditions and the following disclaimer in the.\" documentation and/or other materials provided with the distribution..\" 3. All advertising materials mentioning features or use of this software.\" must display the following acknowledgement:.\" This product includes software developed by the University of.\" California, Berkeley and its contributors..\" 4. Neither the name of the University nor the names of its contributors.\" may be used to endorse or promote products derived from this software.\" without specific prior written permission..\".\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION).\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF.\" SUCH DAMAGE..\".\" @(#)0.t 8.1 (Berkeley) 6/8/93.\".if n .ND.TLBerkeley Software Architecture Manual.br4.4BSD Edition.AUWilliam Joy, Robert Fabry,.AUSamuel Leffler, M. Kirk McKusick,.AUMichael Karels.AIComputer Systems Research GroupComputer Science DivisionDepartment of Electrical Engineering and Computer ScienceUniversity of California, BerkeleyBerkeley, CA 94720.EH 'PSD:5-%''4.4BSD Architecture Manual'.OH '4.4BSD Architecture Manual''PSD:5-%'.AB.FS* UNIX is a trademark of Bell Laboratories..FEThis document summarizes the facilitiesprovided by the 4.4BSD version of the UNIX\|* operating system.It does not attempt to act as a tutorial for use of the systemnor does it attempt to explain or justify the design of thesystem facilities.It gives neither motivation nor implementation details,in favor of brevity..PPThe first section describes the basic kernel functionsprovided to a UNIX process: process naming and protection,memory management, software interrupts,object references (descriptors), time and statistics functions,and resource controls.These facilities, as well as facilities forbootstrap, shutdown and process accounting,are provided solely by the kernel..PPThe second section describes the standard systemabstractions forfiles and file systems,communication,terminal handling,and process control and debugging.These facilities are implemented by the operating system or bynetwork server processes..AE.LP.bp.ft B.br.sv 2.ceTABLE OF CONTENTS.ft R.LP.sp 1.nf.B "Introduction.".LP.if t .sp .5v.nf.B "0. Notation and types".LP.if t .sp .5v.nf.B "1. Kernel primitives".LP.if t .sp .5v.nf.nf\fB1.1. Processes and protection\fP1.1.1. Host and process identifiers1.1.2. Process creation and termination1.1.3. User and group ids1.1.4. Process groups.LP.nf\fB1.2. Memory management\fP1.2.1. Text, data and stack1.2.2. Mapping pages1.2.3. Page protection control1.2.4. Giving and getting advice1.2.5. Protection primitives.LP.if t .sp .5v.nf\fB1.3. Signals\fP1.3.1. Overview1.3.2. Signal types1.3.3. Signal handlers1.3.4. Sending signals1.3.5. Protecting critical sections1.3.6. Signal stacks.LP.if t .sp .5v.nf\fB1.4. Timing and statistics\fP1.4.1. Real time1.4.2. Interval time.LP.if t .sp .5v.nf\fB1.5. Descriptors\fP1.5.1. The reference table1.5.2. Descriptor properties1.5.3. Managing descriptor references1.5.4. Multiplexing requests1.5.5. Descriptor wrapping.LP.if t .sp .5v.nf\fB1.6. Resource controls\fP1.6.1. Process priorities1.6.2. Resource utilization1.6.3. Resource limits.LP.if t .sp .5v.nf\fB1.7. System operation support\fP1.7.1. Bootstrap operations1.7.2. Shutdown operations1.7.3. Accounting.bp.LP.if t .sp .5v.sp 1.nf\fB2. System facilities\fP.LP.if t .sp .5v.nf\fB2.1. Generic operations\fP2.1.1. Read and write2.1.2. Input/output control2.1.3. Non-blocking and asynchronous operations.LP.if t .sp .5v.nf\fB2.2. File system\fP2.2.1 Overview2.2.2. Naming2.2.3. Creation and removal2.2.3.1. Directory creation and removal2.2.3.2. File creation2.2.3.3. Creating references to devices2.2.3.4. Portal creation2.2.3.6. File, device, and portal removal2.2.4. Reading and modifying file attributes2.2.5. Links and renaming2.2.6. Extension and truncation2.2.7. Checking accessibility2.2.8. Locking2.2.9. Disc quotas.LP.if t .sp .5v.nf\fB2.3. Interprocess communication\fP2.3.1. Interprocess communication primitives2.3.1.1.\0 Communication domains2.3.1.2.\0 Socket types and protocols2.3.1.3.\0 Socket creation, naming and service establishment2.3.1.4.\0 Accepting connections2.3.1.5.\0 Making connections2.3.1.6.\0 Sending and receiving data2.3.1.7.\0 Scatter/gather and exchanging access rights2.3.1.8.\0 Using read and write with sockets2.3.1.9.\0 Shutting down halves of full-duplex connections2.3.1.10.\0 Socket and protocol options2.3.2. UNIX domain2.3.2.1. Types of sockets2.3.2.2. Naming2.3.2.3. Access rights transmission2.3.3. INTERNET domain2.3.3.1. Socket types and protocols2.3.3.2. Socket naming2.3.3.3. Access rights transmission2.3.3.4. Raw access.LP.if t .sp .5v.nf\fB2.4. Terminals and devices\fP2.4.1. Terminals2.4.1.1. Terminal input2.4.1.1.1 Input modes2.4.1.1.2 Interrupt characters2.4.1.1.3 Line editing2.4.1.2. Terminal output2.4.1.3. Terminal control operations2.4.1.4. Terminal hardware support2.4.2. Structured devices2.4.3. Unstructured devices.LP.if t .sp .5v.nf\fB2.5. Process control and debugging\fP.LP.if t .sp .5v.nf\fBI. Summary of facilities\fP.LP.de sh.ds RH \\$1.bp.NH \\*(ss\s+2\\$1\s0.PP.PP...bp.ds ss 1.de _d.if t .ta .6i 2.1i 2.6i.\" 2.94 went to 2.6, 3.64 to 3.30.if n .ta .84i 2.6i 3.30i...de _f.if t .ta .5i 1.25i 2.5i 3.5i.\" 3.5i went to 3.8i.if n .ta .7i 1.75i 3.8i 4.8i...nr H1 -1.sh "Notation and types.PPThe notation used to describe system calls is a variant of aC language call, consisting of a prototype call followed bydeclaration 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 insection 2.1:.DScc = read(fd, buf, nbytes);result int cc; int fd; result char *buf; int nbytes;.DEThe first line shows how the \fIread\fP routine is called, withthree parameters.As shown on the second line \fIcc\fP is an integer and \fIread\fP alsoreturns information in the parameter \fIbuf\fP..PPDescription of all error conditions arising from each system callis not provided here; they appear in the programmer's manual.In particular, when accessed from the C language,many calls return a characteristic \-1 valuewhen an error occurs, returning the error code in the global variable\fIerrno\fP.Other languages may present errors in different ways..PPA number of system standard types are defined in the include file.I <sys/types.h>and used in the specifications here and in many C programs.These include \fBcaddr_t\fP giving a memory address (typically asa character pointer), \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\fPand \fBu_long\fP, shorthand names for \fBunsigned char\fP, \fBunsignedshort\fP, etc.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -