cleanups and edits for accuracy
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Fri, 27 May 1994 13:31:00 +0000 (05:31 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Fri, 27 May 1994 13:31:00 +0000 (05:31 -0800)
SCCS-vsn: share/doc/psd/05.sysman/0.t 8.3
SCCS-vsn: share/doc/psd/05.sysman/1.0.t 8.3
SCCS-vsn: share/doc/psd/05.sysman/1.1.t 8.5
SCCS-vsn: share/doc/psd/05.sysman/1.4.t 8.4
SCCS-vsn: share/doc/psd/05.sysman/1.5.t 8.5
SCCS-vsn: share/doc/psd/05.sysman/1.2.t 8.6
SCCS-vsn: share/doc/psd/05.sysman/1.3.t 8.5
SCCS-vsn: share/doc/psd/05.sysman/2.3.t 8.4
SCCS-vsn: share/doc/psd/05.sysman/1.6.t 8.4
SCCS-vsn: share/doc/psd/05.sysman/1.7.t 8.4
SCCS-vsn: share/doc/psd/05.sysman/2.0.t 8.4
SCCS-vsn: share/doc/psd/05.sysman/2.1.t 8.4
SCCS-vsn: share/doc/psd/05.sysman/2.2.t 8.5
SCCS-vsn: share/doc/psd/05.sysman/2.4.t 8.4
SCCS-vsn: share/doc/psd/05.sysman/2.5.t 8.4

15 files changed:
usr/src/share/doc/psd/05.sysman/0.t
usr/src/share/doc/psd/05.sysman/1.0.t
usr/src/share/doc/psd/05.sysman/1.1.t
usr/src/share/doc/psd/05.sysman/1.2.t
usr/src/share/doc/psd/05.sysman/1.3.t
usr/src/share/doc/psd/05.sysman/1.4.t
usr/src/share/doc/psd/05.sysman/1.5.t
usr/src/share/doc/psd/05.sysman/1.6.t
usr/src/share/doc/psd/05.sysman/1.7.t
usr/src/share/doc/psd/05.sysman/2.0.t
usr/src/share/doc/psd/05.sysman/2.1.t
usr/src/share/doc/psd/05.sysman/2.2.t
usr/src/share/doc/psd/05.sysman/2.3.t
usr/src/share/doc/psd/05.sysman/2.4.t
usr/src/share/doc/psd/05.sysman/2.5.t

index 953e24f..e5d63be 100644 (file)
@@ -1,9 +1,9 @@
-.\" Copyright (c) 1983, 1993
+.\" Copyright (c) 1983, 1993, 1994
 .\"    The Regents of the University of California.  All rights reserved.
 .\"
 .\" %sccs.include.redist.roff%
 .\"
 .\"    The Regents of the University of California.  All rights reserved.
 .\"
 .\" %sccs.include.redist.roff%
 .\"
-.\"    @(#)0.t 8.2 (Berkeley) %G%
+.\"    @(#)0.t 8.3 (Berkeley) %G%
 .\"
 .if n .ND
 .TL
 .\"
 .if n .ND
 .TL
@@ -27,7 +27,7 @@ Berkeley, CA  94720
 .AB
 This document summarizes the system calls
 provided by the 4.4BSD operating system.
 .AB
 This document summarizes the system calls
 provided by the 4.4BSD operating system.
-It does not attempt to act as a tutorial for use of the 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
 system facilities.
 It gives neither motivation nor implementation details,
 nor does it attempt to explain or justify the design of the
 system facilities.
 It gives neither motivation nor implementation details,
@@ -78,8 +78,8 @@ network server processes.
 .Sh 0 "Notation and Types
 .PP
 The notation used to describe system calls is a variant of a
 .Sh 0 "Notation and Types
 .PP
 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.
+C language function call, consisting of a prototype call followed by
+the 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
 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
@@ -87,29 +87,59 @@ section
 .Xr 2.1.1 :
 .DS
 cc = read(fd, buf, nbytes);
 .Xr 2.1.1 :
 .DS
 cc = read(fd, buf, nbytes);
-result int cc; int fd; result char *buf; int nbytes;
+result ssize_t cc; int fd; result void *buf; size_t nbytes;
 .DE
 The first line shows how the \fIread\fP routine is called, with
 three parameters.
 .DE
 The first line shows how the \fIread\fP routine is called, with
 three parameters.
-As shown on the second line \fIcc\fP is an integer and \fIread\fP also
-returns information in the parameter \fIbuf\fP.
+As shown on the second line,
+the return value \fIcc\fP is a size_t and \fIread\fP
+also returns information in the parameter \fIbuf\fP.
 .PP
 .PP
-Description of all error conditions arising from each system call
-is not provided here; they appear in section
+The descriptions of error conditions arising from each system call
+are not provided here; they appear in section
 .Xr 2
 .Xr 2
-of the programmer's reference manual.
+of the Programmer's Reference 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
 \fIerrno\fP.
 Other languages may present errors in different ways.
 .PP
 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
 \fIerrno\fP.
 Other languages may present errors in different ways.
 .PP
-A number of system standard types are defined in the include file
+A number of system standard types are defined by the include file
 .I <sys/types.h>
 and used in the specifications here and in many C programs.
 .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 as
-a character pointer), 
-\fBoff_t\fP giving a file offset (typically as a 64-bit 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
-short\fP, etc.
+.sp
+.ft C
+.TS
+l l l.
+Type   Value
+_
+caddr_t        char *  /* a memory address */
+clock_t        unsigned long   /* count of CLK_TCK's */
+gid_t  unsigned long   /* group ID */
+int16_t        short   /* 16-bit integer */
+int32_t        int     /* 32-bit integer */
+int64_t        long long       /* 64-bit integer */
+int8_t signed char     /* 8-bit integer */
+mode_t unsigned short  /* file permissions */
+off_t  quad_t  /* file offset */
+pid_t  long    /* process ID */
+qaddr_t        quad_t *
+quad_t long long
+size_t unsigned int    /* count of bytes */
+ssize_t        int     /* signed size_t */
+time_t long    /* seconds since the Epoch */
+u_char unsigned char
+u_int  unsigned int
+u_int16_t      unsigned short  /* unsigned 16-bit integer */
+u_int32_t      unsigned int    /* unsigned 32-bit integer */
+u_int64_t      unsigned long long      /* unsigned 64-bit integer */
+u_int8_t       unsigned char   /* unsigned 8-bit integer */
+u_long unsigned long
+u_quad_t       unsigned long long
+u_short        unsigned short
+uid_t  unsigned long   /* user ID */
+uint   unsigned int    /* System V compatibility */
+ushort unsigned short  /* System V compatibility */
+.TE
+.ft R
index d36209b..8c5ca4a 100644 (file)
@@ -1,9 +1,9 @@
-.\" Copyright (c) 1983, 1993
+.\" Copyright (c) 1983, 1993, 1994
 .\"    The Regents of the University of California.  All rights reserved.
 .\"
 .\" %sccs.include.redist.roff%
 .\"
 .\"    The Regents of the University of California.  All rights reserved.
 .\"
 .\" %sccs.include.redist.roff%
 .\"
-.\"    @(#)1.0.t       8.2 (Berkeley) %G%
+.\"    @(#)1.0.t       8.3 (Berkeley) %G%
 .\"
 .Sh 1 "Kernel primitives
 .PP
 .\"
 .Sh 1 "Kernel primitives
 .PP
@@ -11,20 +11,20 @@ The facilities available to a user process are logically
 divided into two parts: kernel facilities directly implemented by
 code running in the operating system, and system facilities
 implemented either by the system, or in cooperation with a
 divided into two parts: kernel facilities directly implemented by
 code running in the operating system, and system facilities
 implemented either by the system, or in cooperation with a
-\fIserver process\fP.  These kernel facilities are described
-in this, section
+\fIserver process\fP.
+The kernel facilities are described in section
 .Xr 1 .
 .PP
 The facilities implemented in the kernel are those which define the
 \fI4.4BSD virtual machine\fP in which each process runs.
 Like many real machines, this virtual machine has memory management hardware,
 an interrupt facility, timers and counters.  The 4.4BSD
 .Xr 1 .
 .PP
 The facilities implemented in the kernel are those which define the
 \fI4.4BSD virtual machine\fP in which each process runs.
 Like many real machines, this virtual machine has memory management hardware,
 an interrupt facility, timers and counters.  The 4.4BSD
-virtual machine also allows access to files and other objects through a set of
+virtual machine allows access to files and other objects through a set of
 \fIdescriptors\fP.  Each descriptor resembles a device controller,
 and supports a set of operations.  Like devices on real machines, some
 of which are internal to the machine and some of which are external,
 parts of the descriptor machinery are built-in to the operating system, while
 \fIdescriptors\fP.  Each descriptor resembles a device controller,
 and supports a set of operations.  Like devices on real machines, some
 of which are internal to the machine and some of which are external,
 parts of the descriptor machinery are built-in to the operating system, while
-other parts are often implemented in server processes on other machines.
+other parts are implemented in server processes on other machines.
 The facilities provided through the descriptor machinery are described in
 section
 .Xr 2 .
 The facilities provided through the descriptor machinery are described in
 section
 .Xr 2 .
index 44e94a1..0ca0ebb 100644 (file)
@@ -3,13 +3,13 @@
 .\"
 .\" %sccs.include.redist.roff%
 .\"
 .\"
 .\" %sccs.include.redist.roff%
 .\"
-.\"    @(#)1.1.t       8.4 (Berkeley) %G%
+.\"    @(#)1.1.t       8.5 (Berkeley) %G%
 .\"
 .Sh 2 "Processes and protection
 .Sh 3 "Host identifiers
 .PP
 .\"
 .Sh 2 "Processes and protection
 .Sh 3 "Host identifiers
 .PP
-Each host has associated with it a 32-bit host ID, and a host
-name of up to MAXHOSTNAMELEN (64) characters (as defined in
+Each host has associated with it an integer host ID, and a host
+name of up to MAXHOSTNAMELEN (256) characters (as defined in
 \fI<sys/param.h>\fP).
 These identifiers are set (by a privileged user) and retrieved using the
 .Fn sysctl
 \fI<sys/param.h>\fP).
 These identifiers are set (by a privileged user) and retrieved using the
 .Fn sysctl
@@ -20,7 +20,7 @@ For convenience and backward compatibility,
 the following library routines are provided:
 .DS
 .Fd sethostid 1 "set host identifier
 the following library routines are provided:
 .DS
 .Fd sethostid 1 "set host identifier
-sethostid(hostid)
+sethostid(hostid);
 long hostid;
 .DE
 .DS
 long hostid;
 .DE
 .DS
@@ -30,12 +30,12 @@ result long hostid;
 .DE
 .DS
 .Fd sethostname 2 "set host name
 .DE
 .DS
 .Fd sethostname 2 "set host name
-sethostname(name, len)
+sethostname(name, len);
 char *name; int len;
 .DE
 .DS
 .Fd gethostname 2 "get host name
 char *name; int len;
 .DE
 .DS
 .Fd gethostname 2 "get host name
-len = gethostname(buf, buflen)
+len = gethostname(buf, buflen);
 result int len; result char *buf; int buflen;
 .DE
 .Sh 3 "Process identifiers
 result int len; result char *buf; int buflen;
 .DE
 .Sh 3 "Process identifiers
@@ -80,7 +80,7 @@ The
 call returns twice, once in the parent process, where
 \fIpid\fP is the process identifier of the child,
 and once in the child process where \fIpid\fP is 0.
 call returns twice, once in the parent process, where
 \fIpid\fP is the process identifier of the child,
 and once in the child process where \fIpid\fP is 0.
-The parent-child relationship induces a hierarchical structure on
+The parent-child relationship imposes a hierarchical structure on
 the set of processes in the system.
 .PP
 For processes that are forking solely for the purpose of
 the set of processes in the system.
 .PP
 For processes that are forking solely for the purpose of
@@ -108,14 +108,14 @@ A process may terminate by executing an
 call:
 .DS
 .Fd exit 1 "terminate a process
 call:
 .DS
 .Fd exit 1 "terminate a process
-exit(status)
+exit(status);
 int status;
 .DE
 int status;
 .DE
-returning 8 bits of exit status to its parent.
+The lower 8 bits of exit status are available to its parent.
 .PP
 When a child process exits or
 terminates abnormally, the parent process receives
 .PP
 When a child process exits or
 terminates abnormally, the parent process receives
-information about any
+information about the
 event which caused termination of the child process.
 The interface allows the parent to wait for a particular process,
 process group, or any direct descendent and
 event which caused termination of the child process.
 The interface allows the parent to wait for a particular process,
 process group, or any direct descendent and
@@ -136,8 +136,8 @@ A process can overlay itself with the memory image of another process,
 passing the newly created process a set of parameters, using the call:
 .DS
 .Fd execve 3 "execute a new program
 passing the newly created process a set of parameters, using the call:
 .DS
 .Fd execve 3 "execute a new program
-execve(name, argv, envp)
-char *name, **argv, **envp;
+execve(name, argv, envp);
+char *name, *argv[], *envp[];
 .DE
 The specified \fIname\fP must be a file which is in a format recognized
 by the system, either a binary executable file or a file which causes
 .DE
 The specified \fIname\fP must be a file which is in a format recognized
 by the system, either a binary executable file or a file which causes
@@ -153,15 +153,16 @@ saved group ID.
 .PP
 Each process in the system has associated with it three user IDs:
 a \fIreal user ID\fP, an \fIeffective user ID\fP, and a \fIsaved user ID\fP,
 .PP
 Each process in the system has associated with it three user IDs:
 a \fIreal user ID\fP, an \fIeffective user ID\fP, and a \fIsaved user ID\fP,
-all 32-bit unsigned integers (type \fBuid_t\fP).
+all unsigned integral types (\fBuid_t\fP).
 Each process has a \fIreal group ID\fP
 and a set of \fIaccess group IDs\fP,
 the first of which is the \fIeffective group ID\fP.
 Each process has a \fIreal group ID\fP
 and a set of \fIaccess group IDs\fP,
 the first of which is the \fIeffective group ID\fP.
-The group IDs are 32-bit unsigned integers (type \fBgid_t\fP).
-Each process may be in several different access groups, with the maximum
-concurrent number of access groups a system compilation parameter,
-the constant NGROUPS in the file \fI<sys/param.h>\fP,
-guaranteed to be at least eight.
+The group IDs are unsigned integral types (\fBgid_t\fP).
+Each process may be in multiple access groups.
+The maximum concurrent number of access groups is a system compilation
+parameter,
+represented by the constant NGROUPS in the file \fI<sys/param.h>\fP.
+It is guaranteed to be at least 16.
 .LP
 The real group ID is used in process accounting and in testing whether
 the effective group ID may be changed; it is not otherwise used for
 .LP
 The real group ID is used in process accounting and in testing whether
 the effective group ID may be changed; it is not otherwise used for
@@ -222,7 +223,7 @@ gid_t gid;
 .DE
 .DS
 .Fd setgroups 2 "set access group set
 .DE
 .DS
 .Fd setgroups 2 "set access group set
-setgroups(gidsetsize, gidset)
+setgroups(gidsetsize, gidset);
 int gidsetsize; gid_t gidset[gidsetsize];
 .DE
 The
 int gidsetsize; gid_t gidset[gidsetsize];
 .DE
 The
@@ -268,8 +269,9 @@ The session is created with the call:
 pid = setsid();
 result pid_t pid;
 .DE
 pid = setsid();
 result pid_t pid;
 .DE
-All subsequent processes created by the user that do not call
-.Fn setsid
+All subsequent processes created by the user
+(that do not call
+.Fn setsid )
 will be part of the session.
 The session also has a login name associated with it
 which is set using the privileged call:
 will be part of the session.
 The session also has a login name associated with it
 which is set using the privileged call:
@@ -284,9 +286,9 @@ The login name can be retrieved using the call:
 name = getlogin();
 result char *name;
 .DE
 name = getlogin();
 result char *name;
 .DE
-Unlike earlier systems, the return value of
+Unlike historic systems, the value returned by
 .Fn getlogin
 .Fn getlogin
-can be trusted.
+is stored in the kernel and can be trusted.
 .Sh 3 "Process groups
 .PP
 Each process in the system is also associated with a \fIprocess
 .Sh 3 "Process groups
 .PP
 Each process in the system is also associated with a \fIprocess
@@ -306,8 +308,8 @@ When a process is in a specific process group it may receive
 software interrupts affecting the group, causing the group to
 suspend or resume execution or to be interrupted or terminated.
 In particular, a system terminal has a process group and only processes
 software interrupts affecting the group, causing the group to
 suspend or resume execution or to be interrupted or terminated.
 In particular, a system terminal has a process group and only processes
-which are in the process group of the terminal may read from the
-terminal, allowing arbitration of terminals among several different jobs.
+which are in the process group of the terminal may read from the terminal,
+allowing arbitration of a terminal among several different jobs.
 .LP
 The process group associated with a process may be changed by the
 .Fn setpgid
 .LP
 The process group associated with a process may be changed by the
 .Fn setpgid
@@ -315,9 +317,10 @@ call:
 .DS
 .Fd setpgid 2 "set process group
 setpgid(pid, pgrp);
 .DS
 .Fd setpgid 2 "set process group
 setpgid(pid, pgrp);
-int pid, pgrp;
+pid_t pid, pgrp;
 .DE
 Newly created processes are assigned process IDs distinct from all
 processes and process groups, and the same process group as their
 .DE
 Newly created processes are assigned process IDs distinct from all
 processes and process groups, and the same process group as their
-parent.  A normal (unprivileged) process may set its process group equal
-to its process ID or to the value of any process group within its session.
+parent.
+Any process may set its process group equal to its process ID or
+to the value of any process group within its session.
index 2b23ae1..408aa16 100644 (file)
@@ -3,16 +3,18 @@
 .\"
 .\" %sccs.include.redist.roff%
 .\"
 .\"
 .\" %sccs.include.redist.roff%
 .\"
-.\"    @(#)1.2.t       8.5 (Berkeley) %G%
+.\"    @(#)1.2.t       8.6 (Berkeley) %G%
 .\"
 .Sh 2 "Memory management
 .Sh 3 "Text, data, and stack
 .PP
 Each process begins execution with three logical areas of memory
 called text, data, and stack.  
 .\"
 .Sh 2 "Memory management
 .Sh 3 "Text, data, and stack
 .PP
 Each process begins execution with three logical areas of memory
 called text, data, and stack.  
-The text area is read-only and shared, while the data and stack
-areas are private to the process.  Both the data and stack areas may
-be extended and contracted on program request.  The call:
+The text area is read-only and shared,
+while the data and stack areas are writable and private to the process.
+Both the data and stack areas may be extended and contracted on program
+request.
+The call:
 .DS
 .Fd brk 1 "set data section size
 brk(addr);
 .DS
 .Fd brk 1 "set data section size
 brk(addr);
@@ -26,12 +28,12 @@ and the base of the new area returned with the call:
 addr = sbrk(incr);
 result caddr_t addr; int incr;
 .DE
 addr = sbrk(incr);
 result caddr_t addr; int incr;
 .DE
-Application programs usually use the library routines
-.Fn malloc ,
+Application programs normally use the library routines
+.Fn malloc
 and
 and
-.Fn free
-that provide a more convenient interface to
-.Fn brk ,
+.Fn free ,
+which provide a more convenient interface than
+.Fn brk
 and
 .Fn sbrk .
 .LP
 and
 .Fn sbrk .
 .LP
@@ -48,7 +50,8 @@ Protection and sharing options are defined in \fI<sys/mman.h>\fP as:
 .TS
 l s
 l l.
 .TS
 l s
 l l.
-Protections are chosen from these bits, or-ed together
+Protections are chosen from these bits, or-ed together:
+
 PROT_READ      /* pages can be read */
 PROT_WRITE     /* pages can be written */
 PROT_EXEC      /* pages can be executed */
 PROT_READ      /* pages can be read */
 PROT_WRITE     /* pages can be written */
 PROT_EXEC      /* pages can be executed */
@@ -58,7 +61,8 @@ PROT_EXEC     /* pages can be executed */
 .TS
 l s
 l l.
 .TS
 l s
 l l.
-Flags contain sharing type and options. Sharing options, choose one
+Flags contain sharing type and options.  Sharing options, choose one:
+
 MAP_SHARED     /* share changes */
 MAP_PRIVATE    /* changes are private */
 .TE
 MAP_SHARED     /* share changes */
 MAP_PRIVATE    /* changes are private */
 .TE
@@ -67,25 +71,25 @@ MAP_PRIVATE /* changes are private */
 .TS
 l s
 l l.
 .TS
 l s
 l l.
-Other flags \(dg
+Option flags\(dg:
+
 MAP_ANON       /* allocated from virtual memory; \fIfd\fP ignored */
 MAP_FIXED      /* map addr must be exactly as requested */
 MAP_NORESERVE  /* don't reserve needed swap area */
 MAP_INHERIT    /* region is retained after exec */
 MAP_HASSEMAPHORE       /* region may contain semaphores */
 MAP_ANON       /* allocated from virtual memory; \fIfd\fP ignored */
 MAP_FIXED      /* map addr must be exactly as requested */
 MAP_NORESERVE  /* don't reserve needed swap area */
 MAP_INHERIT    /* region is retained after exec */
 MAP_HASSEMAPHORE       /* region may contain semaphores */
-MAP_RENAME     /* Sun: rename private pages to file */
 .TE
 .DE
 .FS
 .TE
 .DE
 .FS
-\(dg Currently only MAP_ANON and MAP_FIXED are implemented.
+\(dg In 4.4BSD, only MAP_ANON and MAP_FIXED are implemented.
 .FE
 .FE
-The cpu-dependent size of a page is returned by the
+The size of a page is cpu-dependent, and is returned by the
 .Fn sysctl
 interface described in section
 .Xr 1.7.1 .
 .Fn sysctl
 interface described in section
 .Xr 1.7.1 .
-For convenience and backward compatibility, the
+The
 .Fn getpagesize
 .Fn getpagesize
-library routine is provided:
+library routine is provided for convenience and backward compatibility:
 .DS
 .Fd getpagesize 0 "get system page size
 pagesize = getpagesize();
 .DS
 .Fd getpagesize 0 "get system page size
 pagesize = getpagesize();
@@ -107,9 +111,11 @@ for the convenience of the system,
 it may differ from that supplied
 unless the MAP_FIXED flag is given,
 in which case the exact address will be used or the call will fail.
 it may differ from that supplied
 unless the MAP_FIXED flag is given,
 in which case the exact address will be used or the call will fail.
-The \fIaddr\fP and \fIpos\fP parameters
-must be multiples of the pagesize,
-\fIlen\fP will be rounded by the system as necessary.
+The \fIaddr\fP parameter
+must be a multiple of the pagesize (if MAP_FIXED is given).
+If \fIpos\fP and \fIlen\fP are not a multiple of pagesize,
+they will be rounded by the system as necessary;
+the rounding may cause the mapped region to extend past the specified range.
 A successful
 .Fn mmap
 will delete any previous mapping
 A successful
 .Fn mmap
 will delete any previous mapping
@@ -160,6 +166,7 @@ If \fIlen\fP is non-zero, only the pages containing \fIaddr\fP and \fIlen\fP
 succeeding locations will be examined.
 Any required synchronization of memory caches
 will also take place at this time.
 succeeding locations will be examined.
 Any required synchronization of memory caches
 will also take place at this time.
+.LP
 Filesystem operations on a file that is mapped for shared modifications
 are currently unpredictable except after an
 .Fn msync .
 Filesystem operations on a file that is mapped for shared modifications
 are currently unpredictable except after an
 .Fn msync .
@@ -210,7 +217,6 @@ MADV_RANDOM /* expect random page references */
 MADV_SEQUENTIAL        /* expect sequential references */
 MADV_WILLNEED  /* will need these pages */
 MADV_DONTNEED  /* don't need these pages */
 MADV_SEQUENTIAL        /* expect sequential references */
 MADV_WILLNEED  /* will need these pages */
 MADV_DONTNEED  /* don't need these pages */
-MADV_SPACEAVAIL        /* ensure that resources are reserved */
 .TE
 .DE
 The
 .TE
 .DE
 The
@@ -219,8 +225,8 @@ function allows a process to obtain information
 about whether pages are memory resident:
 .DS
 .Fd mincore 3 "get advise about use of memory
 about whether pages are memory resident:
 .DS
 .Fd mincore 3 "get advise about use of memory
-mincore(addr, len, vec)
-caddr_t addr; int len; result char *vec;
+mincore(addr, len, vec);
+caddr_t addr; size_t len; result char *vec;
 .DE
 Here the current memory residency of the pages is returned
 in the character array \fIvec\fP, with a value of 1 meaning
 .DE
 Here the current memory residency of the pages is returned
 in the character array \fIvec\fP, with a value of 1 meaning
@@ -250,7 +256,7 @@ caddr_t addr; size_t len;
 After the
 .Fn munlock
 call, the pages in the specified address range are still accessible
 After the
 .Fn munlock
 call, the pages in the specified address range are still accessible
-but may be paged out if memory is short and they are not accessed.
+but may be paged out if memory is needed and they are not accessed.
 .Sh 3 "Synchronization primitives
 Primitives are provided for synchronization using semaphores
 in shared memory.\(dd
 .Sh 3 "Synchronization primitives
 Primitives are provided for synchronization using semaphores
 in shared memory.\(dd
@@ -258,7 +264,7 @@ in shared memory.\(dd
 \(dd All currently unimplemented, no entry points exists.
 .FE
 These primitives are expected to be superseded by the semaphore
 \(dd All currently unimplemented, no entry points exists.
 .FE
 These primitives are expected to be superseded by the semaphore
-interface being specified by the POSIX Pthread standard.
+interface being specified by the POSIX 1003 Pthread standard.
 They are provided as an efficient interim solution.
 Application programmers are encouraged to use the Pthread interface
 when it becomes available.
 They are provided as an efficient interim solution.
 Application programmers are encouraged to use the Pthread interface
 when it becomes available.
@@ -269,12 +275,12 @@ The MAP_HASSEMAPHORE flag must have been specified when the region was created.
 To acquire a lock a process calls:
 .DS
 .Fd mset 2 "acquire and set a semaphore
 To acquire a lock a process calls:
 .DS
 .Fd mset 2 "acquire and set a semaphore
-value = mset(sem, wait)
+value = mset(sem, wait);
 result int value; semaphore *sem; int wait;
 .DE
 .Fn Mset
 indivisibly tests and sets the semaphore \fIsem\fP.
 result int value; semaphore *sem; int wait;
 .DE
 .Fn Mset
 indivisibly tests and sets the semaphore \fIsem\fP.
-If the the previous value is zero, the process has acquired the lock and
+If the previous value is zero, the process has acquired the lock and
 .Fn mset
 returns true immediately.
 Otherwise, if the \fIwait\fP flag is zero,
 .Fn mset
 returns true immediately.
 Otherwise, if the \fIwait\fP flag is zero,
@@ -286,7 +292,7 @@ relinquishes the processor until notified that it should retry.
 To release a lock a process calls:
 .DS
 .Fd mclear 2 "release a semaphore and awaken waiting processes
 To release a lock a process calls:
 .DS
 .Fd mclear 2 "release a semaphore and awaken waiting processes
-mclear(sem)
+mclear(sem);
 semaphore *sem;
 .DE
 .Fn Mclear
 semaphore *sem;
 .DE
 .Fn Mclear
@@ -308,7 +314,7 @@ A process may relinquish the processor by calling
 with a set semaphore:
 .DS
 .Fd msleep 1 "wait for a semaphore
 with a set semaphore:
 .DS
 .Fd msleep 1 "wait for a semaphore
-msleep(sem)
+msleep(sem);
 semaphore *sem;
 .DE
 If the semaphore is still set when it is checked by the kernel,
 semaphore *sem;
 .DE
 If the semaphore is still set when it is checked by the kernel,
@@ -318,7 +324,7 @@ until some other process issues an
 for the same semaphore within the region using the call:
 .DS
 .Fd mwakeup 1 "awaken process(es) sleeping on a semaphore
 for the same semaphore within the region using the call:
 .DS
 .Fd mwakeup 1 "awaken process(es) sleeping on a semaphore
-mwakeup(sem)
+mwakeup(sem);
 semaphore *sem;
 .DE
 An
 semaphore *sem;
 .DE
 An
index d5dc251..55ac99b 100644 (file)
@@ -3,7 +3,7 @@
 .\"
 .\" %sccs.include.redist.roff%
 .\"
 .\"
 .\" %sccs.include.redist.roff%
 .\"
-.\"    @(#)1.3.t       8.4 (Berkeley) %G%
+.\"    @(#)1.3.t       8.5 (Berkeley) %G%
 .\"
 .Sh 2 "Signals
 .PP
 .\"
 .Sh 2 "Signals
 .PP
@@ -13,26 +13,27 @@ The system defines a set of \fIsignals\fP that may be delivered
 to a process.  Signal delivery resembles the occurrence of a hardware
 interrupt: the signal is blocked from further occurrence,
 the current process context is saved, and a new one
 to a process.  Signal delivery resembles the occurrence of a hardware
 interrupt: the signal is blocked from further occurrence,
 the current process context is saved, and a new one
-is built.  A process may specify
-the \fIhandler\fP to which a signal is delivered, or specify that
-the signal is to be \fIblocked\fP or \fIignored\fP.  A process may
-also specify that a
+is built.
+A process may specify a \fIhandler\fP to which a signal is delivered,
+or specify that the signal is to be \fIblocked\fP or \fIignored\fP.
+A process may also specify that a
 \fIdefault\fP action is to be taken when signals occur.
 .PP
 \fIdefault\fP action is to be taken when signals occur.
 .PP
-Some signals
-will cause a process to exit when they are not caught.  This
-may be accompanied by creation of a \fIcore\fP image file, containing
+Some signals will cause a process to exit if they are not caught.
+This may be accompanied by creation of a \fIcore\fP image file,
+containing
 the current memory image of the process for use in post-mortem debugging.
 the current memory image of the process for use in post-mortem debugging.
-A process may choose to have signals delivered on a special
-stack, so that sophisticated software stack manipulations are possible.
+A process may also choose to have signals delivered on a special stack,
+so that sophisticated software stack manipulations are possible.
 .PP
 .PP
-All signals have the same \fIpriority\fP.  If multiple signals
-are pending simultaneously, signals that may be generated by the
+All signals have the same \fIpriority\fP.
+If multiple signals are pending,
+signals that may be generated by the
 program's action are delivered first; the order in which other signals
 program's action are delivered first; the order in which other signals
-are delivered to a process is implementation specific.
+are delivered to a process is not specified.
 Signal routines execute
 with the signal that caused their invocation \fIblocked\fP, but other
 Signal routines execute
 with the signal that caused their invocation \fIblocked\fP, but other
-signals may yet occur.
+signals may occur.
 Multiple signals may be delivered on a single entry to the system,
 as if signal handlers were interrupted by other signal handlers.
 Mechanisms are provided whereby critical sections
 Multiple signals may be delivered on a single entry to the system,
 as if signal handlers were interrupted by other signal handlers.
 Mechanisms are provided whereby critical sections
@@ -43,15 +44,15 @@ The signals defined by the system fall into one of
 five classes: hardware conditions,
 software conditions, input/output notification, process control, or
 resource control.
 five classes: hardware conditions,
 software conditions, input/output notification, process control, or
 resource control.
-The set of signals is defined in the file \fI<signal.h>\fP.
+The set of signals is defined by the file \fI<signal.h>\fP.
 .PP
 Hardware signals are derived from exceptional conditions which
 may occur during
 execution.  Such signals include SIGFPE representing floating
 point and other arithmetic exceptions, SIGILL for illegal instruction
 .PP
 Hardware signals are derived from exceptional conditions which
 may occur during
 execution.  Such signals include SIGFPE representing floating
 point and other arithmetic exceptions, SIGILL for illegal instruction
-execution, SIGSEGV for addresses outside the currently assigned
-area of memory, and SIGBUS for accesses that violate memory
-access constraints.
+execution, SIGSEGV for attempts to access addresses outside the
+currently assigned area of memory,
+and SIGBUS for accesses that violate memory access constraints.
 .PP
 Software signals reflect interrupts generated by user request:
 SIGINT for the normal interrupt signal; SIGQUIT for the more
 .PP
 Software signals reflect interrupts generated by user request:
 SIGINT for the normal interrupt signal; SIGQUIT for the more
@@ -84,8 +85,8 @@ Processes may receive notification with a SIGCHLD signal when
 a child process changes state, either by stopping or by terminating.
 .PP
 Exceeding resource limits may cause signals to be generated.
 a child process changes state, either by stopping or by terminating.
 .PP
 Exceeding resource limits may cause signals to be generated.
-SIGXCPU occurs when a process nears its CPU time limit and SIGXFSZ
-warns that the limit on file size creation has been reached.
+SIGXCPU occurs when a process nears its CPU time limit and
+SIGXFSZ when a process reaches the limit on file size.
 .Sh 3 "Signal handlers
 .PP
 A process has a handler associated with each signal.
 .Sh 3 "Signal handlers
 .PP
 A process has a handler associated with each signal.
@@ -104,7 +105,7 @@ struct sigaction {
 .DE
 .DS
 .Fd sigaction 3 "setup software signal handler
 .DE
 .DS
 .Fd sigaction 3 "setup software signal handler
-sigaction(signo, sa, osa)
+sigaction(signo, sa, osa);
 int signo; struct sigaction *sa; result struct sigaction *osa;
 .DE
 assigns interrupt handler address \fIsa_handler\fP to signal \fIsigno\fP.
 int signo; struct sigaction *sa; result struct sigaction *osa;
 .DE
 assigns interrupt handler address \fIsa_handler\fP to signal \fIsigno\fP.
@@ -136,17 +137,15 @@ If \fIosa\fP is non-zero, the previous signal handler information is returned.
 When a signal condition arises for a process, the signal
 is added to a set of signals pending for the process.
 If the signal is not currently \fIblocked\fP by the process
 When a signal condition arises for a process, the signal
 is added to a set of signals pending for the process.
 If the signal is not currently \fIblocked\fP by the process
-then it will be delivered.  The process of signal delivery
-adds the signal to be delivered and those signals
-specified in the associated signal
+it then will be delivered.
+The process of signal delivery adds the signal to be delivered
+and those signals specified in the associated signal
 handler's \fIsa_mask\fP to a set of those \fImasked\fP
 for the process, saves the current process context,
 and places the process in the context of the signal
 handling routine.  The call is arranged so that if the signal
 handling routine returns normally, the signal mask will be restored
 and the process will resume execution in the original context.
 handler's \fIsa_mask\fP to a set of those \fImasked\fP
 for the process, saves the current process context,
 and places the process in the context of the signal
 handling routine.  The call is arranged so that if the signal
 handling routine returns normally, the signal mask will be restored
 and the process will resume execution in the original context.
-If the process wishes to resume in a different context, then
-it must arrange to restore the signal mask itself.
 .PP
 The mask of \fIblocked\fP signals is independent of handlers for
 signals.  It delays signals from being delivered much as a
 .PP
 The mask of \fIblocked\fP signals is independent of handlers for
 signals.  It delays signals from being delivered much as a
@@ -184,14 +183,14 @@ with the call:
 .DS
 .Fd kill 2 "send signal to a process
 kill(pid, signo)
 .DS
 .Fd kill 2 "send signal to a process
 kill(pid, signo)
-int pid, signo;
+pid_t pid; int signo;
 .DE
 For compatibility with old systems,
 a compatibility routine is provided to send a signal to a process group:
 .DS
 .Fd killpg 2 "send signal to a process group
 killpg(pgrp, signo)
 .DE
 For compatibility with old systems,
 a compatibility routine is provided to send a signal to a process group:
 .DS
 .Fd killpg 2 "send signal to a process group
 killpg(pgrp, signo)
-int pgrp, signo;
+pid_t pgrp; int signo;
 .DE
 Unless the process sending the signal is privileged,
 it must have the same effective user id as the process receiving the signal.
 .DE
 Unless the process sending the signal is privileged,
 it must have the same effective user id as the process receiving the signal.
index 76db9c3..6bd35c5 100644 (file)
@@ -3,17 +3,17 @@
 .\"
 .\" %sccs.include.redist.roff%
 .\"
 .\"
 .\" %sccs.include.redist.roff%
 .\"
-.\"    @(#)1.4.t       8.3 (Berkeley) %G%
+.\"    @(#)1.4.t       8.4 (Berkeley) %G%
 .\"
 .Sh 2 "Timers
 .Sh 3 "Real time
 .PP
 .\"
 .Sh 2 "Timers
 .Sh 3 "Real time
 .PP
-The system's notion of the current time in Coordinated Universal Time
+The system's notion of the current time is in Coordinated Universal Time
 (UTC, previously GMT) and the current time
 (UTC, previously GMT) and the current time
-zone is set and returned by the call by the calls:
+zone is set and returned by the calls:
 .DS
 .Fd settimeofday 2 "set date and time
 .DS
 .Fd settimeofday 2 "set date and time
-settimeofday(tvp, tzp);
+settimeofday(tp, tzp);
 struct timeval *tp;
 struct timezone *tzp;
 .DE
 struct timeval *tp;
 struct timezone *tzp;
 .DE
@@ -48,8 +48,8 @@ The precision of the system clock is hardware dependent.
 Earlier versions of UNIX contained only a 1-second resolution version
 of this call, which remains as a library routine:
 .DS
 Earlier versions of UNIX contained only a 1-second resolution version
 of this call, which remains as a library routine:
 .DS
-time(tvsec)
-result long *tvsec;
+time(tvsec);
+result time_t *tvsec;
 .DE
 returning only the tv_sec field from the
 .Fn gettimeofday
 .DE
 returning only the tv_sec field from the
 .Fn gettimeofday
@@ -114,13 +114,13 @@ getitimer(which, value);
 int which; result struct itimerval *value;
 .DE
 The \fIit_value\fP specifies the time until the next signal;
 int which; result struct itimerval *value;
 .DE
 The \fIit_value\fP specifies the time until the next signal;
-the \fIit_interval\fP specified a new interval that should
+the \fIit_interval\fP specifies a new interval that should
 be loaded into the timer on each expiration.
 The third argument to
 .Fn setitimer
 specifies an optional structure
 to receive the previous contents of the interval timer.
 be loaded into the timer on each expiration.
 The third argument to
 .Fn setitimer
 specifies an optional structure
 to receive the previous contents of the interval timer.
-A timer can be disabled by specifying a timer value of 0.
+A timer can be disabled by setting \fIit_value\fP and \fIit_interval\fP to 0.
 .PP
 The system rounds argument timer intervals to be not less than the
 resolution of its clock.  This clock resolution can be determined
 .PP
 The system rounds argument timer intervals to be not less than the
 resolution of its clock.  This clock resolution can be determined
@@ -145,5 +145,5 @@ execution statistics for a process:
 profil(samples, size, offset, scale);
 result char *samples; int size, offset, scale;
 .DE
 profil(samples, size, offset, scale);
 result char *samples; int size, offset, scale;
 .DE
-This call begins sampling of the program counter,
+This call begins sampling the program counter,
 with statistics maintained in the user-provided buffer.
 with statistics maintained in the user-provided buffer.
index 598c020..95e9aab 100644 (file)
@@ -3,22 +3,22 @@
 .\"
 .\" %sccs.include.redist.roff%
 .\"
 .\"
 .\" %sccs.include.redist.roff%
 .\"
-.\"    @(#)1.5.t       8.4 (Berkeley) %G%
+.\"    @(#)1.5.t       8.5 (Berkeley) %G%
 .\"
 .Sh 2 Descriptors
 .Sh 3 "The reference table
 .PP
 Each process has access to resources through
 \fIdescriptors\fP.  Each descriptor is a handle allowing
 .\"
 .Sh 2 Descriptors
 .Sh 3 "The reference table
 .PP
 Each process has access to resources through
 \fIdescriptors\fP.  Each descriptor is a handle allowing
-the process to reference objects such as files, devices
+processes to reference objects such as files, devices
 and communications links.
 .PP
 Rather than allowing processes direct access to descriptors, the system
 introduces a level of indirection, so that descriptors may be shared
 between processes.  Each process has a \fIdescriptor reference table\fP,
 and communications links.
 .PP
 Rather than allowing processes direct access to descriptors, the system
 introduces a level of indirection, so that descriptors may be shared
 between processes.  Each process has a \fIdescriptor reference table\fP,
-containing pointers to the actual descriptors.  The descriptors
-themselves thus have multiple references, and are reference counted by the
-system.
+containing pointers to the actual descriptors.
+The descriptors themselves therefore may have multiple references,
+and are reference counted by the system.
 .PP
 Each process has a limited size descriptor reference table, where
 the current size is returned by the
 .PP
 Each process has a limited size descriptor reference table, where
 the current size is returned by the
@@ -29,7 +29,7 @@ call:
 nds = getdtablesize();
 result int nds;
 .DE
 nds = getdtablesize();
 result int nds;
 .DE
-and guaranteed to be at least 20.
+and guaranteed to be at least 64.
 The maximum number of descriptors is a resource limit (see section
 .Xr 1.6.3 ).
 The entries in the descriptor reference
 The maximum number of descriptors is a resource limit (see section
 .Xr 1.6.3 ).
 The entries in the descriptor reference
@@ -62,8 +62,9 @@ A duplicate of a descriptor reference may be made by doing:
 new = dup(old);
 result int new; int old;
 .DE
 new = dup(old);
 result int new; int old;
 .DE
-returning a copy of descriptor reference \fIold\fP indistinguishable from
-the original.  The \fInew\fP chosen by the system will be the
+returning a copy of descriptor reference \fIold\fP which is
+indistinguishable from the original.
+The value of \fInew\fP chosen by the system will be the
 smallest unused descriptor reference slot.
 A copy of a descriptor reference may be made in a specific slot
 by doing:
 smallest unused descriptor reference slot.
 A copy of a descriptor reference may be made in a specific slot
 by doing:
@@ -101,11 +102,12 @@ nds = select(nd, in, out, except, tvp);
 result int nds; int nd; result fd_set *in, *out, *except;
 struct timeval *tvp;
 
 result int nds; int nd; result fd_set *in, *out, *except;
 struct timeval *tvp;
 
-FD_ZERO(&fdset);
-FD_SET(fd, &fdset);
 FD_CLR(fd, &fdset);
 FD_CLR(fd, &fdset);
+FD_COPY(&fdset, &fdset2);
 FD_ISSET(fd, &fdset);
 FD_ISSET(fd, &fdset);
-int fd; fs_set fdset;
+FD_SET(fd, &fdset);
+FD_ZERO(&fdset);
+int fd; fs_set fdset, fdset2;
 .DE
 The
 .Fn select
 .DE
 The
 .Fn select
@@ -125,7 +127,9 @@ such as
 .Fn read
 or
 .Fn receive
 .Fn read
 or
 .Fn receive
-is possible, or if a connection request may be accepted (see section
+is possible, or if a connection request may be accepted (see sections
+.Xr 2.1.3
+and
 .Xr 2.3.1.4 ).
 .IP \*(bu
 A descriptor selects for output if an output oriented operation
 .Xr 2.3.1.4 ).
 .IP \*(bu
 A descriptor selects for output if an output oriented operation
@@ -135,8 +139,10 @@ or
 .Fn send
 is possible, or if an operation
 that was ``in progress'', such as connection establishment,
 .Fn send
 is possible, or if an operation
 that was ``in progress'', such as connection establishment,
-has completed (see section
-.Xr 2.1.3 ).
+has completed (see sections
+.Xr 2.1.3
+and
+.Xr 2.3.1.5 ).
 .IP \*(bu
 A descriptor selects for an exceptional condition if a condition
 that would cause a SIGURG signal to be generated exists (see section
 .IP \*(bu
 A descriptor selects for an exceptional condition if a condition
 that would cause a SIGURG signal to be generated exists (see section
@@ -144,8 +150,8 @@ that would cause a SIGURG signal to be generated exists (see section
 or other device-specific events have occurred.
 .LP
 For these tests, an operation is considered to be possible if a call
 or other device-specific events have occurred.
 .LP
 For these tests, an operation is considered to be possible if a call
-to the operation would return without blocking even if the O_NONBLOCK
-flag were clear.
+to the operation would return without blocking (even if the O_NONBLOCK
+flag were not set).
 For example, a descriptor would test as ready for reading if a read
 call would return immediately with data, an end-of-file indication,
 or an error other than EWOULDBLOCK.
 For example, a descriptor would test as ready for reading if a read
 call would return immediately with data, an end-of-file indication,
 or an error other than EWOULDBLOCK.
@@ -161,7 +167,7 @@ Options affecting I/O on a descriptor
 may be read and set by the call:
 .DS
 .Fd fcntl 3 "file control
 may be read and set by the call:
 .DS
 .Fd fcntl 3 "file control
-dopt = fcntl(d, cmd, arg)
+dopt = fcntl(d, cmd, arg);
 result int dopt; int d, cmd, arg;
 .DE
 .DS
 result int dopt; int d, cmd, arg;
 .DE
 .DS
@@ -169,12 +175,16 @@ result int dopt; int d, cmd, arg;
 l s
 l l.
 /* command values */
 l s
 l l.
 /* command values */
+F_DUPFD        /* return a new descriptor */
 F_GETFD        /* get file descriptor flags */
 F_SETFD        /* set file descriptor flags */
 F_GETFL        /* get file status flags */
 F_SETFL        /* set file status flags */
 F_GETOWN       /* get SIGIO/SIGURG proc/pgrp */
 F_SETOWN       /* set SIGIO/SIGURG proc/pgrp */
 F_GETFD        /* get file descriptor flags */
 F_SETFD        /* set file descriptor flags */
 F_GETFL        /* get file status flags */
 F_SETFL        /* set file status flags */
 F_GETOWN       /* get SIGIO/SIGURG proc/pgrp */
 F_SETOWN       /* set SIGIO/SIGURG proc/pgrp */
+F_GETLK        /* get blocking lock */
+F_SETLK        /* set or clear lock */
+F_SETLKW       /* set lock with wait */
 .TE
 .DE
 The F_SETFD \fIcmd\fP can be used to set the close-on-exec
 .TE
 .DE
 The F_SETFD \fIcmd\fP can be used to set the close-on-exec
@@ -189,9 +199,8 @@ The
 system call also provides POSIX-compliant byte-range locking on files.
 However the semantics of unlocking on every 
 .Fn close
 system call also provides POSIX-compliant byte-range locking on files.
 However the semantics of unlocking on every 
 .Fn close
-rather than last close makes them almost useless.
-Much better semantics, and faster locking are provided
-by the
+rather than last close makes them useless.
+Much better semantics and faster locking are provided by the
 .Fn flock
 system call (see section
 .Xr 2.2.7 ).
 .Fn flock
 system call (see section
 .Xr 2.2.7 ).
index ab5b905..9202ef4 100644 (file)
@@ -3,7 +3,7 @@
 .\"
 .\" %sccs.include.redist.roff%
 .\"
 .\"
 .\" %sccs.include.redist.roff%
 .\"
-.\"    @(#)1.6.t       8.3 (Berkeley) %G%
+.\"    @(#)1.6.t       8.4 (Berkeley) %G%
 .\"
 .Sh 2 "Resource controls
 .Sh 3 "Process priorities
 .\"
 .Sh 2 "Resource controls
 .Sh 3 "Process priorities
@@ -50,7 +50,7 @@ current process (RUSAGE_SELF),
 or all its terminated descendent processes (RUSAGE_CHILDREN):
 .DS
 .Fd getrusage 2 "get information about resource utilization
 or all its terminated descendent processes (RUSAGE_CHILDREN):
 .DS
 .Fd getrusage 2 "get information about resource utilization
-getrusage(who, rusage)
+getrusage(who, rusage);
 int who; result struct rusage *rusage;
 .DE
 The information is returned in a structure defined in \fI<sys/resource.h>\fP:
 int who; result struct rusage *rusage;
 .DE
 The information is returned in a structure defined in \fI<sys/resource.h>\fP:
@@ -88,12 +88,12 @@ and
 calls:
 .DS
 .Fd getrlimit 2 "get maximum system resource consumption
 calls:
 .DS
 .Fd getrlimit 2 "get maximum system resource consumption
-getrlimit(resource, rlp)
+getrlimit(resource, rlp);
 int resource; result struct rlimit *rlp;
 .DE
 .DS
 .Fd setrlimit 2 "set maximum system resource consumption
 int resource; result struct rlimit *rlp;
 .DE
 .DS
 .Fd setrlimit 2 "set maximum system resource consumption
-setrlimit(resource, rlp)
+setrlimit(resource, rlp);
 int resource; struct rlimit *rlp;
 .DE
 The resources that may currently be controlled include:
 int resource; struct rlimit *rlp;
 .DE
 The resources that may currently be controlled include:
index c2f63ef..45fe3c8 100644 (file)
@@ -3,7 +3,7 @@
 .\"
 .\" %sccs.include.redist.roff%
 .\"
 .\"
 .\" %sccs.include.redist.roff%
 .\"
-.\"    @(#)1.7.t       8.3 (Berkeley) %G%
+.\"    @(#)1.7.t       8.4 (Berkeley) %G%
 .\"
 .Sh 2 "System operation support
 .LP
 .\"
 .Sh 2 "System operation support
 .LP
@@ -17,7 +17,7 @@ function allows any process to retrieve system information
 and allows processes with appropriate privileges to set system configurations.
 .DS
 .Fd sysctl 6 "get or set system information
 and allows processes with appropriate privileges to set system configurations.
 .DS
 .Fd sysctl 6 "get or set system information
-sysctl(name, namelen, oldp, oldlenp, newp, newlen)
+sysctl(name, namelen, oldp, oldlenp, newp, newlen);
 int *name; u_int namelen; result void *oldp; result size_t *oldlenp;
 void *newp; size_t newlen;
 .DE
 int *name; u_int namelen; result void *oldp; result size_t *oldlenp;
 void *newp; size_t newlen;
 .DE
@@ -44,11 +44,12 @@ rather than slash-separated strings.
 The information is copied into the buffer specified by \fIoldp\fP.
 The size of the buffer is given by the location specified by \fIoldlenp\fP
 before the call,
 The information is copied into the buffer specified by \fIoldp\fP.
 The size of the buffer is given by the location specified by \fIoldlenp\fP
 before the call,
-and that location gives the amount of data copied after a successful call.
+and that location is filled in with the amount of data copied after
+a successful call.
 If the amount of data available is greater
 than the size of the buffer supplied,
 the call supplies as much data as fits in the buffer provided
 If the amount of data available is greater
 than the size of the buffer supplied,
 the call supplies as much data as fits in the buffer provided
-and returns with the error code ENOMEM.
+and returns an error.
 .PP
 To set a new value, \fInewp\fP
 is set to point to a buffer of length \fInewlen\fP
 .PP
 To set a new value, \fInewp\fP
 is set to point to a buffer of length \fInewlen\fP
@@ -65,6 +66,7 @@ in the include files listed here:
 .TS
 l l l.
 Name   Next Level Names        Description
 .TS
 l l l.
 Name   Next Level Names        Description
+_
 CTL\_DEBUG     sys/sysctl.h    Debugging
 CTL\_FS        sys/sysctl.h    Filesystem
 CTL\_HW        sys/sysctl.h    Generic CPU, I/O
 CTL\_DEBUG     sys/sysctl.h    Debugging
 CTL\_FS        sys/sysctl.h    Filesystem
 CTL\_HW        sys/sysctl.h    Generic CPU, I/O
@@ -92,16 +94,15 @@ The argument \fIdata\fP describes the filesystem object to be mounted
 according to the \fItype\fP.
 The contents of the filesystem become available through the
 new mount point \fIdir\fP.
 according to the \fItype\fP.
 The contents of the filesystem become available through the
 new mount point \fIdir\fP.
-Any files in \fIdir\fP at the time of a successful mount
-are swept under the carpet so to speak,
-and are unavailable until the filesystem is unmounted.
-The \fIflags\fP specifies generic properties,
+Any files in or below \fIdir\fP at the time of a successful mount
+disappear from the name space until the filesystem is unmounted.
+The \fIflags\fP value specifies generic properties,
 such as a request to mount the filesystem read-only.
 .LP
 such as a request to mount the filesystem read-only.
 .LP
-Information about all the mounted filesystems can be obtained with the call:
+Information about all mounted filesystems can be obtained with the call:
 .DS
 .Fd getfsstat 3 "get list of all mounted filesystems
 .DS
 .Fd getfsstat 3 "get list of all mounted filesystems
-getfsstat(buf, bufsize, flags)
+getfsstat(buf, bufsize, flags);
 result struct statfs *buf; long bufsize, int flags;
 .DE
 .LP
 result struct statfs *buf; long bufsize, int flags;
 .DE
 .LP
@@ -129,7 +130,7 @@ The call:
 .Fd sync 0 "force completion of pending disk writes (flush cache)
 sync();
 .DE
 .Fd sync 0 "force completion of pending disk writes (flush cache)
 sync();
 .DE
-schedules input/output to clean all system buffer caches.
+schedules I/O to flush all modified disk blocks resident in the kernel.
 (This call does not require privileged status.)
 Files can be selectively flushed to disk using the
 .Fn fsync
 (This call does not require privileged status.)
 Files can be selectively flushed to disk using the
 .Fn fsync
@@ -139,12 +140,13 @@ call (see section
 The call:
 .DS
 .Fd reboot 1 "reboot system or halt processor
 The call:
 .DS
 .Fd reboot 1 "reboot system or halt processor
-reboot(how)
+reboot(how);
 int how;
 .DE
 causes a machine halt or reboot.  The call may request a reboot
 by specifying \fIhow\fP as RB_AUTOBOOT, or that the machine be halted
 int how;
 .DE
 causes a machine halt or reboot.  The call may request a reboot
 by specifying \fIhow\fP as RB_AUTOBOOT, or that the machine be halted
-with RB_HALT.  These constants are defined in \fI<sys/reboot.h>\fP.
+with RB_HALT, among other options.
+These constants are defined in \fI<sys/reboot.h>\fP.
 .Sh 3 "Accounting
 .PP
 The system optionally keeps an accounting record in a file
 .Sh 3 "Accounting
 .PP
 The system optionally keeps an accounting record in a file
@@ -156,5 +158,5 @@ The accounting may be enabled to a file \fIname\fP by doing:
 acct(path);
 char *path;
 .DE
 acct(path);
 char *path;
 .DE
-If \fIpath\fP is null, then accounting is disabled.  Otherwise,
-the named file becomes the accounting file.
+If \fIpath\fP is NULL, then accounting is disabled.
+Otherwise, the named file becomes the accounting file.
index 4078170..7557fba 100644 (file)
@@ -1,9 +1,9 @@
-.\" Copyright (c) 1983, 1993
+.\" Copyright (c) 1983, 1993, 1994
 .\"    The Regents of the University of California.  All rights reserved.
 .\"
 .\" %sccs.include.redist.roff%
 .\"
 .\"    The Regents of the University of California.  All rights reserved.
 .\"
 .\" %sccs.include.redist.roff%
 .\"
-.\"    @(#)2.0.t       8.3 (Berkeley) %G%
+.\"    @(#)2.0.t       8.4 (Berkeley) %G%
 .\"
 .Sh 1 "System facilities
 .LP
 .\"
 .Sh 1 "System facilities
 .LP
@@ -15,17 +15,17 @@ space.  Operations on files and other named objects in a filesystem are
 always specified relative to such a context.
 .IP "Files
 .br
 always specified relative to such a context.
 .IP "Files
 .br
-Files are used to store uninterpreted sequence of bytes on which
-random access \fIreads\fP and \fIwrites\fP may occur.
-Pages from files may also be mapped into process address space.
+Files are used to store uninterpreted sequences of bytes,
+which may be \fIread\fP and \fIwritten\fP randomly.
+Pages from files may also be mapped into the process address space.
 A directory may be read as a file if permitted by the underlying
 storage facility,
 though it is usually accessed using
 .Fn getdirentries
 (see section
 .Xr 2.2.3.1 ).
 A directory may be read as a file if permitted by the underlying
 storage facility,
 though it is usually accessed using
 .Fn getdirentries
 (see section
 .Xr 2.2.3.1 ).
-(Local filesystems permit directories to be read, although most
-NFS implementations do not allow reading of directories.)
+(Local filesystems permit directories to be read,
+although most NFS implementations do not allow reading of directories.)
 .IP "Communications domains
 .br
 A communications domain represents
 .IP "Communications domains
 .br
 A communications domain represents
@@ -46,11 +46,11 @@ wide variety of communications domains.  Sockets can have different
 increasing the flexibility of the model.
 .IP "Terminals and other devices
 .br
 increasing the flexibility of the model.
 .IP "Terminals and other devices
 .br
-Devices include
-terminals, providing input editing and interrupt generation
-and output flow control and editing, magnetic tapes,
-disks and other peripherals.  They often support the generic
-\fIread\fP and \fIwrite\fP operations as well as a number of \fIioctl\fP\|s.
+Devices include terminals (providing input editing, interrupt
+generation, output flow control, and editing), magnetic tapes,
+disks, and other peripherals.
+They normally support the generic
+\fIread\fP and \fIwrite\fP operations as well as a number of \fIioctl\fP\|'s.
 .IP "Processes
 .br
 Process descriptors provide facilities for control and debugging of
 .IP "Processes
 .br
 Process descriptors provide facilities for control and debugging of
index 27b3c61..f594057 100644 (file)
@@ -1,18 +1,18 @@
-.\" Copyright (c) 1983, 1993
+.\" Copyright (c) 1983, 1993, 1994
 .\"    The Regents of the University of California.  All rights reserved.
 .\"
 .\" %sccs.include.redist.roff%
 .\"
 .\"    The Regents of the University of California.  All rights reserved.
 .\"
 .\" %sccs.include.redist.roff%
 .\"
-.\"    @(#)2.1.t       8.3 (Berkeley) %G%
+.\"    @(#)2.1.t       8.4 (Berkeley) %G%
 .\"
 .Sh 2 "Generic operations
 .PP
 Many system abstractions support the
 .\"
 .Sh 2 "Generic operations
 .PP
 Many system abstractions support the
-operations
 .Fn read ,
 .Fn write ,
 and
 .Fn read ,
 .Fn write ,
 and
-.Fn ioctl .
+.Fn ioctl
+operations.
 We describe the basics of these common primitives here.
 Similarly, the mechanisms whereby normally synchronous operations
 may occur in a non-blocking or asynchronous fashion are
 We describe the basics of these common primitives here.
 Similarly, the mechanisms whereby normally synchronous operations
 may occur in a non-blocking or asynchronous fashion are
@@ -29,12 +29,12 @@ They have the form:
 .DS
 .Fd read 3 "read input
 cc = read(fd, buf, nbytes);
 .DS
 .Fd read 3 "read input
 cc = read(fd, buf, nbytes);
-result int cc; int fd; result caddr_t buf; int nbytes;
+result ssize_t cc; int fd; result void *buf; size_t nbytes;
 .DE
 .DS
 .Fd write 3 "write output
 cc = write(fd, buf, nbytes);
 .DE
 .DS
 .Fd write 3 "write output
 cc = write(fd, buf, nbytes);
-result int cc; int fd; caddr_t buf; int nbytes;
+result ssize_t cc; int fd; void *buf; size_t nbytes;
 .DE
 The
 .Fn read
 .DE
 The
 .Fn read
@@ -52,13 +52,12 @@ call transfers data from the buffer to the
 object defined by \fIfd\fP.  Depending on the type of \fIfd\fP,
 it is possible that the
 .Fn write
 object defined by \fIfd\fP.  Depending on the type of \fIfd\fP,
 it is possible that the
 .Fn write
-call will accept some portion
-of the provided bytes; the user should resubmit the other bytes
-in a later request in this case.
+call will accept only a portion of the provided bytes;
+the user should resubmit the other bytes in a later request.
 Error returns because of interrupted or otherwise incomplete operations
 Error returns because of interrupted or otherwise incomplete operations
-are possible, in which case no data have been transferred.
+are possible, in which case no data will have been transferred.
 .PP
 .PP
-Scattering of data on input or gathering of data for output
+Scattering of data on input, or gathering of data for output
 is also possible using an array of input/output vector descriptors.
 The type for the descriptors is defined in \fI<sys/uio.h>\fP as:
 .DS
 is also possible using an array of input/output vector descriptors.
 The type for the descriptors is defined in \fI<sys/uio.h>\fP as:
 .DS
@@ -66,26 +65,27 @@ The type for the descriptors is defined in \fI<sys/uio.h>\fP as:
 l s s s
 l l l l.
 struct iovec {
 l s s s
 l l l l.
 struct iovec {
-       caddr_t iov_base;       /* base of a component */
-       int     iov_len;        /* length of a component */
+       char    *iov_base;      /* base of a component */
+       size_t  iov_len;        /* length of a component */
 };
 .TE
 };
 .TE
+.DE
 .LP
 The \fIiov_base\fP field should be treated as if its type were
 ``void *'' as POSIX and other versions of the structure may use
 that type.
 Thus, pointer arithmetic should not use this value without a cast.
 .LP
 The \fIiov_base\fP field should be treated as if its type were
 ``void *'' as POSIX and other versions of the structure may use
 that type.
 Thus, pointer arithmetic should not use this value without a cast.
-.DE
+.LP
 The calls using an array of \fIiovec\fP structures are:
 .DS
 .Fd readv 3 "read gathered input
 cc = readv(fd, iov, iovlen);
 The calls using an array of \fIiovec\fP structures are:
 .DS
 .Fd readv 3 "read gathered input
 cc = readv(fd, iov, iovlen);
-result int cc; int fd; struct iovec *iov; int iovlen;
+result ssize_t cc; int fd; struct iovec *iov; int iovlen;
 .DE
 .DS
 .Fd writev 3 "write scattered output
 cc = writev(fd, iov, iovlen);
 .DE
 .DS
 .Fd writev 3 "write scattered output
 cc = writev(fd, iov, iovlen);
-result int cc; int fd; struct iovec *iov; int iovlen;
+result ssize_t cc; int fd; struct iovec *iov; int iovlen;
 .DE
 Here \fIiovlen\fP is the count of elements in the \fIiov\fP array.
 .Sh 3 "Input/output control
 .DE
 Here \fIiovlen\fP is the count of elements in the \fIiov\fP array.
 .Sh 3 "Input/output control
@@ -96,12 +96,12 @@ operation:
 .DS
 .Fd ioctl 3 "control device
 ioctl(fd, request, buffer);
 .DS
 .Fd ioctl 3 "control device
 ioctl(fd, request, buffer);
-int fd, request; caddr_t buffer;
+int fd; u_long request; caddr_t buffer;
 .DE
 This operation causes the specified \fIrequest\fP to be performed
 on the object \fIfd\fP.  The \fIrequest\fP parameter specifies
 whether the argument buffer is to be read, written, read and written,
 .DE
 This operation causes the specified \fIrequest\fP to be performed
 on the object \fIfd\fP.  The \fIrequest\fP parameter specifies
 whether the argument buffer is to be read, written, read and written,
-or is not needed, and also the size of the buffer, as well as the
+or is not used, and also the size of the buffer, as well as the
 request.
 Different descriptor types and subtypes within descriptor types
 may use distinct
 request.
 Different descriptor types and subtypes within descriptor types
 may use distinct
@@ -111,7 +111,8 @@ operations on terminals control flushing of input and output
 queues and setting of terminal parameters; operations on
 disks cause formatting operations to occur; operations on tapes
 control tape positioning.
 queues and setting of terminal parameters; operations on
 disks cause formatting operations to occur; operations on tapes
 control tape positioning.
-The names for basic control operations are defined in \fI<sys/ioctl.h>\fP.
+The names for basic control operations are defined by \fI<sys/ioctl.h>\fP,
+or more specifically by files it includes.
 .Sh 3 "Non-blocking and asynchronous operations
 .PP
 A process that wishes to do non-blocking operations on one of
 .Sh 3 "Non-blocking and asynchronous operations
 .PP
 A process that wishes to do non-blocking operations on one of
index e157fdd..a539c96 100644 (file)
@@ -3,7 +3,7 @@
 .\"
 .\" %sccs.include.redist.roff%
 .\"
 .\"
 .\" %sccs.include.redist.roff%
 .\"
-.\"    @(#)2.2.t       8.4 (Berkeley) %G%
+.\"    @(#)2.2.t       8.5 (Berkeley) %G%
 .\"
 .Sh 2 "Filesystem
 .Sh 3 "Overview
 .\"
 .Sh 2 "Filesystem
 .Sh 3 "Overview
@@ -11,7 +11,7 @@
 The filesystem abstraction provides access to a hierarchical
 filesystem structure.
 The filesystem contains directories (each of which may contain
 The filesystem abstraction provides access to a hierarchical
 filesystem structure.
 The filesystem contains directories (each of which may contain
-other sub-directories) as well as files and references to other
+sub-directories) as well as files and references to other
 objects such as devices and inter-process communications sockets.
 .PP
 Each file is organized as a linear array of bytes.  No record
 objects such as devices and inter-process communications sockets.
 .PP
 Each file is organized as a linear array of bytes.  No record
@@ -22,15 +22,13 @@ If permitted by the underlying storage mechanism,
 the user may read the data in a directory as though
 it were an ordinary file to determine the names of the contained files,
 but only the system may write into the directories.
 the user may read the data in a directory as though
 it were an ordinary file to determine the names of the contained files,
 but only the system may write into the directories.
-The filesystem stores only a small amount of ownership, protection and usage
-information with a file.
 .Sh 3 "Naming
 .PP
 The filesystem calls take \fIpath name\fP arguments.
 These consist of a zero or more component \fIfile names\fP
 separated by ``/\^'' characters, where each file name
 .Sh 3 "Naming
 .PP
 The filesystem calls take \fIpath name\fP arguments.
 These consist of a zero or more component \fIfile names\fP
 separated by ``/\^'' characters, where each file name
-is up to NAME_MAX (255) ASCII characters excluding null and ``/\^''.
-Each pathname is up to PATH_MAX (1024) ASCII characters excluding null.
+is up to NAME_MAX (255) characters excluding null and ``/\^''.
+Each pathname is up to PATH_MAX (1024) characters excluding null.
 .PP
 Each process always has two naming contexts: one for the
 root directory of the filesystem and one for the
 .PP
 Each process always has two naming contexts: one for the
 root directory of the filesystem and one for the
@@ -45,7 +43,7 @@ context.
 The file name ``.'' in each directory refers to that directory.
 The file name ``..'' in each directory refers to
 the parent directory of that directory.
 The file name ``.'' in each directory refers to that directory.
 The file name ``..'' in each directory refers to
 the parent directory of that directory.
-The parent directory of the root of the filesystem is always that directory.
+The parent directory of the root of the filesystem is itself.
 .LP
 The calls:
 .DS
 .LP
 The calls:
 .DS
@@ -60,7 +58,7 @@ int fd;
 .DE
 .DS
 .Fd chroot 1 "change root directory
 .DE
 .DS
 .Fd chroot 1 "change root directory
-chroot(path)
+chroot(path);
 char *path;
 .DE
 change the current working directory or root directory context of a process.
 char *path;
 .DE
 change the current working directory or root directory context of a process.
@@ -109,19 +107,19 @@ Although directories can be read as files,
 the usual interface is to use the call:
 .DS
 .Fd getdirentries 4 "get directory entries in a filesystem independent format
 the usual interface is to use the call:
 .DS
 .Fd getdirentries 4 "get directory entries in a filesystem independent format
-getdirentries(fd, buf, nbytes, basep)
+getdirentries(fd, buf, nbytes, basep);
 int fd; char *buf; int nbytes; long *basep;
 .DE
 The
 .Fn getdirentries
 system call returns a canonical array of directory entries
 int fd; char *buf; int nbytes; long *basep;
 .DE
 The
 .Fn getdirentries
 system call returns a canonical array of directory entries
-in a filesystem independent format described in \fI<dirent.h>\fP.
+in the filesystem independent format described in \fI<dirent.h>\fP.
 Application programs usually use the library routines
 .Fn opendir ,
 .Fn readdir ,
 and
 .Fn closedir
 Application programs usually use the library routines
 .Fn opendir ,
 .Fn readdir ,
 and
 .Fn closedir
-that provide a more convenient interface to
+which provide a more convenient interface than
 .Fn getdirentries .
 The \fIfts\fP package is provided
 for recursive directory traversal.
 .Fn getdirentries .
 The \fIfts\fP package is provided
 for recursive directory traversal.
@@ -165,12 +163,11 @@ on the open file.  The operations will be checked against the user's
 access rights to the file before allowing the
 .Fn open
 to succeed.
 access rights to the file before allowing the
 .Fn open
 to succeed.
-Specifying O_APPEND causes writes to automatically append to the file.
+Specifying O_APPEND causes all writes to be appended to the file.
 Specifying O_TRUNC causes the file to be truncated when opened.
 Specifying O_TRUNC causes the file to be truncated when opened.
-The flag O_CREAT causes the file to be created if it does not
-exist, owned by the current user
-and the group of the containing directory.
-The protection for the new file is specified in \fImode\fP
+The flag O_CREAT causes the file to be created if it does not exist,
+owned by the current user and the group of the containing directory.
+The permissions for the new file are specified in \fImode\fP
 as the OR of the appropriate permissions as defined in \fI<sys/stat.h>\fP:
 .DS
 .TS
 as the OR of the appropriate permissions as defined in \fI<sys/stat.h>\fP:
 .DS
 .TS
@@ -187,15 +184,20 @@ S_IRWXO   /* RWX for other */
 S_IROTH        /* R for other */
 S_IWOTH        /* W for other */
 S_IXOTH        /* X for other */
 S_IROTH        /* R for other */
 S_IWOTH        /* W for other */
 S_IXOTH        /* X for other */
+S_ISUID        /* set user id */
+S_ISGID /* set group id */
+S_ISTXT /* sticky bit */
 .TE
 .DE
 .LP
 .TE
 .DE
 .LP
-Historically, the file mode has been used as a three digit octal number.
-Each digit encodes read access as 4, write access as 2 and execute
-access as 1, or'ed together.  The 0700 bits describe owner
-access, the 070 bits describe the access rights for processes in the same
-group as the file, and the 07 bits describe the access rights
-for other processes.
+Historically, the file mode has been used as a four digit octal number.
+The bottom three digits encode read access as 4, write access as 2 and
+execute access as 1, or'ed together.
+The 0700 bits describe owner access, the 070 bits describe the access
+rights for processes in the same group as the file, and the 07 bits
+describe the access rights for other processes.
+The 7000 bits encode set user ID as 4000, set group ID as 2000, and the
+sticky bit as 1000.
 The mode specified to
 .Fn open
 is modified by 
 The mode specified to
 .Fn open
 is modified by 
@@ -208,14 +210,15 @@ oldmask = umask(newmask);
 result mode_t oldmask; mode_t newmask;
 .DE
 .PP
 result mode_t oldmask; mode_t newmask;
 .DE
 .PP
-If the open specifies to create the file with O_EXCL
-and the file already exists, then the
+If the O_EXCL flag is set, and the file already exists, then the
 .Fn open
 will fail without affecting the file in any way.
 This mechanism provides a simple exclusive access facility.
 .Fn open
 will fail without affecting the file in any way.
 This mechanism provides a simple exclusive access facility.
-If the file exists but is a symbolic link, the open will fail
-regardless of the existence of the file specified by the link.
-The O_SHLOCK and O_EXLOCK allow the file to be atomically
+For security reasons,
+if the O_EXCL flag is set and the file is a symbolic link,
+the open will fail regardless of the existence of the file
+referenced by the link.
+The O_SHLOCK and O_EXLOCK flags allow the file to be atomically
 .Fn open 'ed
 and
 .Fn flock 'ed;
 .Fn open 'ed
 and
 .Fn flock 'ed;
@@ -233,7 +236,8 @@ operations.
 Devices are identified by their ``major'' and ``minor''
 device numbers.  The major device number determines the kind
 of peripheral it is, while the minor device number indicates
 Devices are identified by their ``major'' and ``minor''
 device numbers.  The major device number determines the kind
 of peripheral it is, while the minor device number indicates
-one of possibly many peripherals of that kind.
+either one of possibly many peripherals of that kind, or special
+characteristics of the peripheral.
 Structured devices have all operations done internally
 in ``block'' quantities while unstructured devices
 may have input and output done in varying units, and
 Structured devices have all operations done internally
 in ``block'' quantities while unstructured devices
 may have input and output done in varying units, and
@@ -258,8 +262,8 @@ Fifo's can be created in the filesystem using the call:
 mkfifo(path, mode);
 char *path; mode_t mode;
 .DE
 mkfifo(path, mode);
 char *path; mode_t mode;
 .DE
-The \fImode\fP parameter is used solely specify the access permissions
-on the newly created fifo.
+The \fImode\fP parameter is used solely to specify the access
+permissions of the newly created fifo.
 .Sh 4 "Links and renaming
 .PP
 Links allow multiple names for a file to exist.
 .Sh 4 "Links and renaming
 .PP
 Links allow multiple names for a file to exist.
@@ -306,8 +310,9 @@ call:
 len = readlink(path, buf, bufsize);
 result int len; char *path; result char *buf; int bufsize;
 .DE
 len = readlink(path, buf, bufsize);
 result int len; char *path; result char *buf; int bufsize;
 .DE
-This call returns, in \fIbuf\fP, the null-terminated string
-substituted into pathnames passing through \fIpath\fP\|.
+This call returns, in \fIbuf\fP, the string substituted into
+pathnames passing through \fIpath\fP\|.
+(This string is not NULL terminated.)
 .LP
 Atomic renaming of filesystem resident objects is possible with the
 .Fn rename
 .LP
 Atomic renaming of filesystem resident objects is possible with the
 .Fn rename
@@ -319,6 +324,10 @@ char *oldname, *newname;
 .DE
 where both \fIoldname\fP and \fInewname\fP must be
 in the same filesystem.
 .DE
 where both \fIoldname\fP and \fInewname\fP must be
 in the same filesystem.
+If either \fIoldname\fP or \fInewname\fP is a directory,
+then the other also must be a directory for the
+.Fn rename
+to succeed.
 If \fInewname\fP exists and is a directory, then it must be empty.
 .Sh 4 "File, device, and fifo removal
 .LP
 If \fInewname\fP exists and is a directory, then it must be empty.
 .Sh 4 "File, device, and fifo removal
 .LP
@@ -345,11 +354,11 @@ char *path;
 Subsequent operations on any descriptors open at the time of the
 .Fn revoke
 fail, with the exceptions that a
 Subsequent operations on any descriptors open at the time of the
 .Fn revoke
 fail, with the exceptions that a
-.Fn read
-from a character device file which has been
-revoked returns a count of zero (end of file), and a
 .Fn close
 .Fn close
-call will succeed.
+call will succeed, and a
+.Fn read
+from a character device file which has been revoked returns a count
+of zero (end of file).
 If the file is a special file for a device which is open,
 the device close function is called as if all open references
 to the file had been closed.
 If the file is a special file for a device which is open,
 the device close function is called as if all open references
 to the file had been closed.
@@ -380,7 +389,7 @@ type, protection, ownership, access times,
 size, and a count of hard links.
 If the file is a symbolic link, then the status of the link
 itself (rather than the file the link references)
 size, and a count of hard links.
 If the file is a symbolic link, then the status of the link
 itself (rather than the file the link references)
-may be found using the
+may be obtained using the
 .Fn lstat
 call:
 .DS
 .Fn lstat
 call:
 .DS
@@ -389,37 +398,36 @@ lstat(path, stb);
 char *path; result struct stat *stb;
 .DE
 .PP
 char *path; result struct stat *stb;
 .DE
 .PP
-Newly created files are assigned the user-id of the
-process that created it and the group-id of the directory
-in which it was created.  The ownership of a file may
-be changed by either of the calls:
+Newly created files are assigned the user ID of the process that created
+them and the group ID of the directory in which they were created.
+The ownership of a file may be changed by either of the calls:
 .DS
 .Fd chown 3 "change owner and group of a file
 chown(path, owner, group);
 .DS
 .Fd chown 3 "change owner and group of a file
 chown(path, owner, group);
-char *path; int owner, group;
+char *path; uid_t owner; gid_t group;
 .DE
 .DS
 .Fd fchown 3 "change owner and group of a file
 fchown(fd, owner, group);
 .DE
 .DS
 .Fd fchown 3 "change owner and group of a file
 fchown(fd, owner, group);
-int fd, owner, group;
+int fd, uid_t owner; gid_t group;
 .DE
 .PP
 In addition to ownership, each file has three levels of access
 protection associated with it.  These levels are owner relative,
 .DE
 .PP
 In addition to ownership, each file has three levels of access
 protection associated with it.  These levels are owner relative,
-group relative, and global (all users and groups).  Each level
-of access has separate indicators for read permission, write
-permission, and execute permission.
+group relative, and other.
+Each level of access has separate indicators for read permission,
+write permission, and execute permission.
 The protection bits associated with a file may be set by either
 of the calls:
 .DS
 .Fd chmod 2 "change mode of file
 chmod(path, mode);
 The protection bits associated with a file may be set by either
 of the calls:
 .DS
 .Fd chmod 2 "change mode of file
 chmod(path, mode);
-char *path; int mode;
+char *path; mode_t mode;
 .DE
 .DS
 .Fd fchmod 2 "change mode of file
 fchmod(fd, mode);
 .DE
 .DS
 .Fd fchmod 2 "change mode of file
 fchmod(fd, mode);
-int fd, mode;
+int fd, mode_t mode;
 .DE
 where \fImode\fP is a value indicating the new protection
 of the file, as listed in section
 .DE
 where \fImode\fP is a value indicating the new protection
 of the file, as listed in section
@@ -459,11 +467,11 @@ the system is in single-user mode.
 Finally, the access and modify times on a file may be set by the call:
 .DS
 .Fd utimes 2 "set file access and modification times
 Finally, the access and modify times on a file may be set by the call:
 .DS
 .Fd utimes 2 "set file access and modification times
-utimes(path, tvp)
+utimes(path, tvp);
 char *path; struct timeval *tvp[2];
 .DE
 This is particularly useful when moving files between media,
 char *path; struct timeval *tvp[2];
 .DE
 This is particularly useful when moving files between media,
-to preserve relationships between the times the file was modified.
+to preserve file access and modification times.
 .Sh 3 "Checking accessibility
 .PP
 A process running with
 .Sh 3 "Checking accessibility
 .PP
 A process running with
@@ -477,13 +485,13 @@ call:
 accessible = access(path, how);
 result int accessible; char *path; int how;
 .DE
 accessible = access(path, how);
 result int accessible; char *path; int how;
 .DE
-Here \fIhow\fP is constructed by or'ing the following bits, defined
+\fIHow\fP is constructed by OR'ing the following bits, defined
 in \fI<unistd.h>\fP:
 .DS
 .TS
 l l.
 F_OK   /* file exists */
 in \fI<unistd.h>\fP:
 .DS
 .TS
 l l.
 F_OK   /* file exists */
-X_OK   /* file is executable */
+X_OK   /* file is executable/searchable */
 W_OK   /* file is writable */
 R_OK   /* file is readable */
 .TE
 W_OK   /* file is writable */
 R_OK   /* file is readable */
 .TE
@@ -496,18 +504,18 @@ The
 .Fn pathconf
 and
 .Fn fpathconf
 .Fn pathconf
 and
 .Fn fpathconf
-functions provides a method for applications to determine the current
+functions provide a method for applications to determine the current
 value of a configurable system limit or option variable associated
 with a pathname or file descriptor:
 .DS
 .Fd pathconf 2 "get configurable pathname variables
 value of a configurable system limit or option variable associated
 with a pathname or file descriptor:
 .DS
 .Fd pathconf 2 "get configurable pathname variables
-ans = pathconf(path, name)
-result int ans; char *path; int name;
+ans = pathconf(path, name);
+result long ans; char *path; int name;
 .DE
 .DS
 .Fd fpathconf 2 "get configurable pathname variables
 .DE
 .DS
 .Fd fpathconf 2 "get configurable pathname variables
-ans = fpathconf(fd, name)
-result int ans; int fd, name;
+ans = fpathconf(fd, name);
+result long ans; int fd, name;
 .DE
 For
 .Fn pathconf ,
 .DE
 For
 .Fn pathconf ,
@@ -534,7 +542,7 @@ call may be used:
 oldoffset = lseek(fd, offset, type);
 result off_t oldoffset; int fd; off_t offset; int type;
 .DE
 oldoffset = lseek(fd, offset, type);
 result off_t oldoffset; int fd; off_t offset; int type;
 .DE
-where \fItype\fP is given in \fI<sys/unistd.h>\fP as one of:
+where \fItype\fP is defined by \fI<unistd.h>\fP as one of:
 .DS
 .TS
 l l.
 .DS
 .TS
 l l.
@@ -546,10 +554,11 @@ SEEK_END  /* set file offset to EOF plus offset */
 The call ``lseek(fd, 0, SEEK_CUR)''
 returns the current offset into the file.
 .PP
 The call ``lseek(fd, 0, SEEK_CUR)''
 returns the current offset into the file.
 .PP
-Files may have ``holes'' in them.  Holes are void areas in the
-linear extent of the file where data has never been
-written.  These may be created by seeking to
-a location in a file past the current end-of-file and writing.
+Files may have ``holes'' in them.
+Holes are areas in the linear extent of the file where data has never
+been written.
+These may be created by seeking to a location in a file past the
+current end-of-file and writing.
 Holes are treated by the system as zero valued bytes.
 .LP
 A file may be extended or truncated with either of the calls:
 Holes are treated by the system as zero valued bytes.
 .LP
 A file may be extended or truncated with either of the calls:
@@ -571,14 +580,13 @@ in the system buffer cache.
 The call:
 .DS
 .Fd fsync 1 "synchronize in-core state of a file with that on disk
 The call:
 .DS
 .Fd fsync 1 "synchronize in-core state of a file with that on disk
-fsync(fd)
+fsync(fd);
 int fd;
 .DE
 ensures that the contents of a file are committed to disk
 before returning.
 This feature is used by applications such as editors that
 int fd;
 .DE
 ensures that the contents of a file are committed to disk
 before returning.
 This feature is used by applications such as editors that
-want to ensure the integrity of a new file before
-deleting the backup copy.
+want to ensure the integrity of a new file before continuing.
 .Sh 3 "Locking
 .PP
 The filesystem provides basic facilities that allow cooperating processes
 .Sh 3 "Locking
 .PP
 The filesystem provides basic facilities that allow cooperating processes
@@ -609,7 +617,7 @@ flock(fd, how);
 int fd, how;
 .DE
 where the \fIhow\fP parameter is formed from bits
 int fd, how;
 .DE
 where the \fIhow\fP parameter is formed from bits
-defined in \fI<sys/fcntl.h>\fP:
+defined in \fI<fcntl.h>\fP:
 .DS
 .TS
 l l.
 .DS
 .TS
 l l.
@@ -631,8 +639,8 @@ Advisory locks held by a process are automatically deleted when
 the process terminates.
 .Sh 3 "Disk quotas
 .PP
 the process terminates.
 .Sh 3 "Disk quotas
 .PP
-As an optional facility, each local filesystem may be requested to
-impose limits on a user's or a group's disk usage.
+As an optional facility, each local filesystem can impose limits on a
+user's or group's disk usage.
 Two quantities are limited: the total amount of disk space which
 a user or group may allocate in a filesystem and the total number of files
 a user or group may create in a filesystem.  Quotas are expressed as
 Two quantities are limited: the total amount of disk space which
 a user or group may allocate in a filesystem and the total number of files
 a user or group may create in a filesystem.  Quotas are expressed as
@@ -649,11 +657,11 @@ The
 call enables, disables and manipulates filesystem quotas:
 .DS
 .Fd quotactl 4 "manipulate filesystem quotas
 call enables, disables and manipulates filesystem quotas:
 .DS
 .Fd quotactl 4 "manipulate filesystem quotas
-quotactl(path, cmd, id, addr)
+quotactl(path, cmd, id, addr);
 char *path; int cmd; int id; char *addr;
 .DE
 A quota control command given by cmd operates on the given filename path
 char *path; int cmd; int id; char *addr;
 .DE
 A quota control command given by cmd operates on the given filename path
-for the given user id. The address of an optional command specific data
+for the given user ID. The address of an optional command specific data
 structure, addr, may be given.
 The supported commands include:
 .DS
 structure, addr, may be given.
 The supported commands include:
 .DS
@@ -680,7 +688,7 @@ int flags, void *argstructp;
 is used by the NFS daemons to pass information into
 and out of the kernel and also to enter the kernel as a server daemon.
 The flags argument consists of several bits that show what action is to
 is used by the NFS daemons to pass information into
 and out of the kernel and also to enter the kernel as a server daemon.
 The flags argument consists of several bits that show what action is to
-be taken once in the kernel and the argstructp points to one of three
+be taken once in the kernel and \fIargstructp\fP points to one of three
 structures depending on which bits are set in flags.
 .LP
 The call:
 structures depending on which bits are set in flags.
 .LP
 The call:
@@ -748,7 +756,7 @@ For further information see the
 .Xr mount_portal (8)
 manual page.
 .IP \(bu
 .Xr mount_portal (8)
 manual page.
 .IP \(bu
-The uid/gid remapping filesystem, used primary above NFS filesystems
+The uid/gid remapping filesystem, usually layered above NFS filesystems
 exported to an outside administrative domain.
 For further information see the
 .Xr mount_umap (8)
 exported to an outside administrative domain.
 For further information see the
 .Xr mount_umap (8)
index 6c6f488..d3e1ed5 100644 (file)
@@ -3,7 +3,7 @@
 .\"
 .\" %sccs.include.redist.roff%
 .\"
 .\"
 .\" %sccs.include.redist.roff%
 .\"
-.\"    @(#)2.3.t       8.3 (Berkeley) %G%
+.\"    @(#)2.3.t       8.4 (Berkeley) %G%
 .\"
 .Sh 2 "Interprocess communications
 .Sh 3 "Interprocess communication primitives
 .\"
 .Sh 2 "Interprocess communications
 .Sh 3 "Interprocess communication primitives
@@ -37,6 +37,7 @@ The basic set of socket types is defined in \fI<sys/socket.h>\fP:
 l s
 l l.
 Standard socket types
 l s
 l l.
 Standard socket types
+_
 SOCK_DGRAM     /* datagram */
 SOCK_STREAM    /* virtual circuit */
 SOCK_RAW       /* raw socket */
 SOCK_DGRAM     /* datagram */
 SOCK_STREAM    /* virtual circuit */
 SOCK_RAW       /* raw socket */
@@ -207,7 +208,7 @@ and
 The call:
 .DS
 .Fd pipe 1 "create descriptor pair for interprocess communication
 The call:
 .DS
 .Fd pipe 1 "create descriptor pair for interprocess communication
-pipe(pv)
+pipe(pv);
 result int pv[2];
 .DE
 creates a pair of SOCK_STREAM sockets in the PF_LOCAL domain,
 result int pv[2];
 .DE
 creates a pair of SOCK_STREAM sockets in the PF_LOCAL domain,
@@ -386,12 +387,12 @@ and
 calls are used to control options:
 .DS
 .Fd getsockopt 5 "get options on socket
 calls are used to control options:
 .DS
 .Fd getsockopt 5 "get options on socket
-getsockopt(s, level, optname, optval, optlen)
+getsockopt(s, level, optname, optval, optlen);
 int s, level, optname; result void *optval; result int *optlen;
 .DE
 .DS
 .Fd setsockopt 5 "set options on socket
 int s, level, optname; result void *optval; result int *optlen;
 .DE
 .DS
 .Fd setsockopt 5 "set options on socket
-setsockopt(s, level, optname, optval, optlen)
+setsockopt(s, level, optname, optval, optlen);
 int s, level, optname; void *optval; int optlen;
 .DE
 The option \fIoptname\fP is interpreted at the indicated
 int s, level, optname; void *optval; int optlen;
 .DE
 The option \fIoptname\fP is interpreted at the indicated
@@ -441,14 +442,14 @@ based on one from the XEROX NS family and layered on
 top of IP could be implemented to fill this gap.
 .Sh 4 "Socket naming
 .PP
 top of IP could be implemented to fill this gap.
 .Sh 4 "Socket naming
 .PP
-Sockets in the Internet domain have names composed of the 32-bit
-Internet address, and a 16-bit port number.
+Sockets in the Internet domain have names composed of a 32-bit
+Internet address and a 16-bit port number.
 Options may be used to
 provide IP source routing or security options.
 The 32-bit address is composed of network and host parts;
 the network part is variable in size and is frequency encoded.
 The host part may optionally be interpreted as a subnet field
 Options may be used to
 provide IP source routing or security options.
 The 32-bit address is composed of network and host parts;
 the network part is variable in size and is frequency encoded.
 The host part may optionally be interpreted as a subnet field
-plus the host on subnet; this is is enabled by setting a network address
+plus the host on the subnet; this is is enabled by setting a network address
 mask at boot time.
 .Sh 4 "Access rights transmission
 .PP
 mask at boot time.
 .Sh 4 "Access rights transmission
 .PP
index 9d0443d..2652853 100644 (file)
@@ -1,9 +1,9 @@
-.\" Copyright (c) 1983, 1993
+.\" Copyright (c) 1983, 1993, 1994
 .\"    The Regents of the University of California.  All rights reserved.
 .\"
 .\" %sccs.include.redist.roff%
 .\"
 .\"    The Regents of the University of California.  All rights reserved.
 .\"
 .\" %sccs.include.redist.roff%
 .\"
-.\"    @(#)2.4.t       8.3 (Berkeley) %G%
+.\"    @(#)2.4.t       8.4 (Berkeley) %G%
 .\"
 .Sh 2 "Terminals and Devices
 .Sh 3 "Terminals
 .\"
 .Sh 2 "Terminals and Devices
 .Sh 3 "Terminals
@@ -24,7 +24,8 @@ for a login session.
 A controlling terminal is associated with a session (see section
 .Xr 1.1.4 ).
 A controlling terminal has a foreground process group, which must be
 A controlling terminal is associated with a session (see section
 .Xr 1.1.4 ).
 A controlling terminal has a foreground process group, which must be
-a member of the session with which the terminal is associated.
+a member of the session with which the terminal is associated (see section
+.Xr 1.1.5 ).
 Members of the foreground process group are allowed to read from and write to
 the terminal and change the terminal settings; other process groups from
 the session may be stopped upon attempts to do these operations.
 Members of the foreground process group are allowed to read from and write to
 the terminal and change the terminal settings; other process groups from
 the session may be stopped upon attempts to do these operations.
@@ -92,20 +93,21 @@ be requested in a read without losing information.
 When the terminal is in canonical mode, editing of an input line
 is performed.  Editing facilities allow deletion of the previous
 character or word, or deletion of the current input line. 
 When the terminal is in canonical mode, editing of an input line
 is performed.  Editing facilities allow deletion of the previous
 character or word, or deletion of the current input line. 
-In addition, a special character may be used to reprint the current
-input line after some number of editing operations have been applied.
+In addition,
+a special character may be used to reprint the current input line.
 Certain other characters are also interpreted specially.
 Certain other characters are also interpreted specially.
-Flow control is provided by \fIstop output\fP
+Flow control is provided by the \fIstop output\fP
 and \fIstart output\fP control characters.
 Output may be flushed with the \fIflush output\fP character;
 and \fIstart output\fP control characters.
 Output may be flushed with the \fIflush output\fP character;
-and a \fIliteral character\fP may be used to force literal input
-of the immediately following character in the input line.
+and the \fIliteral character\fP may be used to force the following
+character into the input line, regardless of any special meaning
+it may have.
 .PP
 In noncanonical mode input processing, input bytes are not assembled into
 lines, and erase and kill processing does not occur.
 All input is passed through to the
 reading process immediately and without interpretation.
 .PP
 In noncanonical mode input processing, input bytes are not assembled into
 lines, and erase and kill processing does not occur.
 All input is passed through to the
 reading process immediately and without interpretation.
-Signals may be enabled; here
+Signals and flow control may be enabled; here
 the handler interprets input only by looking
 for characters that cause interrupts or output flow control;
 all other characters are made available.
 the handler interprets input only by looking
 for characters that cause interrupts or output flow control;
 all other characters are made available.
@@ -131,8 +133,8 @@ and expanding tabs.
 Structured devices are typified by disks and magnetic
 tapes, but may represent any random-access device.
 The system performs read-modify-write type buffering actions on block
 Structured devices are typified by disks and magnetic
 tapes, but may represent any random-access device.
 The system performs read-modify-write type buffering actions on block
-devices to allow them to be read and written in a totally random
-access fashion like ordinary files.
+devices to allow them to be read and written in random access
+fashion like ordinary files.
 Filesystems are normally mounted on block devices.
 .Sh 3 "Unstructured devices
 .PP
 Filesystems are normally mounted on block devices.
 .Sh 3 "Unstructured devices
 .PP
index a983d56..fac5420 100644 (file)
@@ -1,9 +1,9 @@
-.\" Copyright (c) 1983, 1993
+.\" Copyright (c) 1983, 1993, 1994
 .\"    The Regents of the University of California.  All rights reserved.
 .\"
 .\" %sccs.include.redist.roff%
 .\"
 .\"    The Regents of the University of California.  All rights reserved.
 .\"
 .\" %sccs.include.redist.roff%
 .\"
-.\"    @(#)2.5.t       8.3 (Berkeley) %G%
+.\"    @(#)2.5.t       8.4 (Berkeley) %G%
 .\"
 .Sh 2 "Process debugging
 .Sh 3 "Traditional debugging
 .\"
 .Sh 2 "Process debugging
 .Sh 3 "Traditional debugging
@@ -26,26 +26,27 @@ Generally, pid is the process ID of the traced process,
 which must be a child (no more distant descendant)
 of the tracing process.
 A process being traced behaves normally until it
 which must be a child (no more distant descendant)
 of the tracing process.
 A process being traced behaves normally until it
-encounters some signal whether internally generated like
+encounters a signal (whether internally generated like
 ``illegal instruction'' or externally generated
 ``illegal instruction'' or externally generated
-like ``interrupt.''
+like ``interrupt'').
 Then the traced process enters a stopped state
 and its parent is notified via
 .Fn wait .
 When the child is in the stopped state,
 its core image can be examined and modified using
 .Fn ptrace .
 Then the traced process enters a stopped state
 and its parent is notified via
 .Fn wait .
 When the child is in the stopped state,
 its core image can be examined and modified using
 .Fn ptrace .
-If desired, another ptrace request can then cause
-the child either to terminate or to continue,
-possibly ignoring the signal.
+Another ptrace request can then cause the child either to terminate
+or to continue, possibly ignoring the signal.
 .PP
 A more general interface is also provided in 4.4BSD;
 the \fImount_procfs\fP filesystem attaches an instance of
 the process name space to the global filesystem name space.
 The conventional mount point is \fI/proc\fP.
 .PP
 A more general interface is also provided in 4.4BSD;
 the \fImount_procfs\fP filesystem attaches an instance of
 the process name space to the global filesystem name space.
 The conventional mount point is \fI/proc\fP.
-The root of the process filesystem contains an entry for each active process.
-These processes are visible as a directory whose name is the process' pid.
-In addition, the special entry curproc references the current process.
+The root of the process filesystem contains an entry for each active
+process.
+These processes are visible as directories named by the process' ID.
+In addition, the special entry \fIcurproc\fP references the current
+process.
 Each directory contains several files, including a \fIctl\fP file.
 The debugger finds (or creates) the process that it wants to
 debug and then issues an attach command via the \fIctl\fP file.
 Each directory contains several files, including a \fIctl\fP file.
 The debugger finds (or creates) the process that it wants to
 debug and then issues an attach command via the \fIctl\fP file.