I'm a document, Jim, not a shell script.

Fix this to not use .sy to generate portions of the document.
Instead, generate the necessary bits with sed beforehand.

Apparently -ms is too feeble to be able to generate tables of contents
with automatically generated page numbers, so add the expected page
numbers into the document and make it possible to turn on a
rudimentary mechanism for crosschecking them. (This mechanism still
requires .sy though. Improvements welcome.)

This makes it unnecessary to build the document twice, or to use
groff in unsafe mode.
This commit is contained in:
dholland 2013-10-06 05:45:19 +00:00
parent 891807de18
commit 10d3e932da
17 changed files with 144 additions and 129 deletions

View File

@ -1,4 +1,4 @@
.\" $NetBSD: 0.t,v 1.4 2005/12/26 20:04:46 perry Exp $
.\" $NetBSD: 0.t,v 1.5 2013/10/06 05:45:19 dholland Exp $
.\"
.\" Copyright (c) 1983, 1993, 1994
.\" The Regents of the University of California. All rights reserved.
@ -78,15 +78,24 @@ network server processes.
.AE
.LP
.bp +3
.sy echo -n >toc
.\" The second argument of .Sh is the page number the section is
.\" expected to begin on. This is extracted into the table of contents
.\" before we begin typesetting. If you have been editing the document
.\" and want to check that the page numbers are still correct,
.\" uncomment the following line and the .sy line two lines down, then
.\" run groff with -U so .sy is allowed. Then check the output pagelog
.\" file. If anyone knows how to change this to an assertion, so .sy
.\" isn't needed and groff will complain if $2 isn't equal to the page
.\" number, please go ahead.
.\".sy echo 'have should-be heading' >pagelog
.de Sh
.sy echo >>toc '.L\\$1 "\\$2" \\n%'
.\".sy echo >>pagelog '\\$2 \\n% "\\$3"'
.ie \\$1=0 \{\
\fB\\$2\fP
\fB\\$3\fP
.\}
.el \{\
.NH \\$1
\\$2
\\$3
.LP
.\}
..
@ -97,9 +106,8 @@ network server processes.
\\$1\\$2
..
.de Fd
.sy echo >>toc '.Nm \\$1 \\$2 "\\$3'
..
.Sh 0 "Notation and Types
.Sh 0 4 "Notation and Types
.PP
The notation used to describe system calls is a variant of a
C language function call, consisting of a prototype call followed by

View File

@ -1,4 +1,4 @@
.\" $NetBSD: 1.0.t,v 1.3 2003/08/07 10:30:48 agc Exp $
.\" $NetBSD: 1.0.t,v 1.4 2013/10/06 05:45:19 dholland Exp $
.\"
.\" Copyright (c) 1983, 1993, 1994
.\" The Regents of the University of California. All rights reserved.
@ -29,7 +29,7 @@
.\"
.\" @(#)1.0.t 8.3 (Berkeley) 5/26/94
.\"
.Sh 1 "Kernel primitives
.Sh 1 4 "Kernel primitives
.PP
The facilities available to a user process are logically
divided into two parts: kernel facilities directly implemented by

View File

@ -1,4 +1,4 @@
.\" $NetBSD: 1.1.t,v 1.3 2003/08/07 10:30:48 agc Exp $
.\" $NetBSD: 1.1.t,v 1.4 2013/10/06 05:45:19 dholland Exp $
.\"
.\" Copyright (c) 1983, 1993, 1994
.\" The Regents of the University of California. All rights reserved.
@ -29,8 +29,8 @@
.\"
.\" @(#)1.1.t 8.5 (Berkeley) 5/26/94
.\"
.Sh 2 "Processes and protection
.Sh 3 "Host identifiers
.Sh 2 5 "Processes and protection
.Sh 3 5 "Host identifiers
.PP
Each host has associated with it an integer host ID, and a host
name of up to MAXHOSTNAMELEN (256) characters (as defined in
@ -62,7 +62,7 @@ char *name; int len;
len = gethostname(buf, buflen);
result int len; result char *buf; int buflen;
.DE
.Sh 3 "Process identifiers
.Sh 3 5 "Process identifiers
Each host runs a set of \fIprocesses\fP.
Each process is largely independent of other processes,
having its own protection domain, address space, timers, and
@ -90,7 +90,7 @@ routine:
pid = getppid();
result pid_t pid;
.DE
.Sh 3 "Process creation and termination
.Sh 3 5 "Process creation and termination
.LP
A new process is created by making a logical duplicate of an
existing process:
@ -173,7 +173,7 @@ the effective group ID is set to the group of the file.
Whether changed or not, the effective user ID is then copied to the
saved user ID, and the effective group ID is copied to the
saved group ID.
.Sh 3 "User and group IDs
.Sh 3 6 "User and group IDs
.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,
@ -282,7 +282,7 @@ real or saved group ID:
setegid(gid);
gid_t gid;
.DE
.Sh 3 "Sessions
.Sh 3 7 "Sessions
.PP
When a user first logs onto the system,
they are put into a session with a controlling process
@ -313,7 +313,7 @@ result char *name;
Unlike historic systems, the value returned by
.Fn getlogin
is stored in the kernel and can be trusted.
.Sh 3 "Process groups
.Sh 3 7 "Process groups
.PP
Each process in the system is also associated with a \fIprocess
group\fP. The group of processes in a process group is sometimes

View File

@ -1,4 +1,4 @@
.\" $NetBSD: 1.2.t,v 1.4 2004/02/13 11:36:08 wiz Exp $
.\" $NetBSD: 1.2.t,v 1.5 2013/10/06 05:45:19 dholland Exp $
.\"
.\" Copyright (c) 1983, 1993, 1994
.\" The Regents of the University of California. All rights reserved.
@ -29,8 +29,8 @@
.\"
.\" @(#)1.2.t 8.9 (Berkeley) 5/29/94
.\"
.Sh 2 "Memory management
.Sh 3 "Text, data, and stack
.Sh 2 8 "Memory management
.Sh 3 8 "Text, data, and stack
.PP
Each process begins execution with three logical areas of memory
called text, data, and stack.
@ -63,7 +63,7 @@ and
.LP
There is no call for extending the stack,
as it is automatically extended as needed.
.Sh 3 "Mapping pages
.Sh 3 8 "Mapping pages
.PP
The system supports sharing of data between processes
by allowing pages to be mapped into memory. These mapped
@ -205,7 +205,7 @@ caddr_t addr; size_t len;
This call deletes the mappings for the specified address range,
and causes further references to addresses within the range
to generate invalid memory references.
.Sh 3 "Page protection control
.Sh 3 10 "Page protection control
.LP
A process can control the protection of pages using the call:
.DS
@ -216,7 +216,7 @@ caddr_t addr; size_t len; int prot;
This call changes the specified pages to have protection \fIprot\fP\|.
Not all implementations will guarantee protection on a page basis;
the granularity of protection changes may be as large as an entire region.
.Sh 3 "Giving and getting advice
.Sh 3 10 "Giving and getting advice
.LP
A process that has knowledge of its memory behavior may
use the
@ -282,7 +282,7 @@ After the
.Fn munlock
call, the pages in the specified address range are still accessible
but may be paged out if memory is needed and they are not accessed.
.Sh 3 "Synchronization primitives
.Sh 3 10 "Synchronization primitives
Primitives are provided for synchronization using semaphores
in shared memory.\(dd
.FS

View File

@ -1,4 +1,4 @@
.\" $NetBSD: 1.3.t,v 1.3 2003/08/07 10:30:48 agc Exp $
.\" $NetBSD: 1.3.t,v 1.4 2013/10/06 05:45:19 dholland Exp $
.\"
.\" Copyright (c) 1983, 1993, 1994
.\" The Regents of the University of California. All rights reserved.
@ -29,9 +29,9 @@
.\"
.\" @(#)1.3.t 8.6 (Berkeley) 5/29/94
.\"
.Sh 2 "Signals
.Sh 2 11 "Signals
.PP
.Sh 3 "Overview
.Sh 3 11 "Overview
.PP
The system defines a set of \fIsignals\fP that may be delivered
to a process. Signal delivery resembles the occurrence of a hardware
@ -62,7 +62,7 @@ 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
of code may protect themselves against the occurrence of specified signals.
.Sh 3 "Signal types
.Sh 3 11 "Signal types
.PP
The signals defined by the system fall into one of
five classes: hardware conditions,
@ -111,7 +111,7 @@ a child process changes state, either by stopping or by terminating.
Exceeding resource limits may cause signals to be generated.
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
.Sh 3 12 "Signal handlers
.PP
A process has a handler associated with each signal.
The handler controls the way the signal is delivered.
@ -200,7 +200,7 @@ If the signal handler makes a call to
the signal mask at the time of the corresponding
.Fn setjmp
is restored.
.Sh 3 "Sending signals
.Sh 3 13 "Sending signals
.LP
A process can send a signal to another process or processes group
with the call:
@ -222,7 +222,7 @@ it must have the same effective user id as the process receiving the signal.
Signals also are sent implicitly from a terminal device to the
process group associated with the terminal when certain input characters
are typed.
.Sh 3 "Protecting critical sections
.Sh 3 13 "Protecting critical sections
.LP
The
.Fn sigprocmask
@ -256,7 +256,7 @@ are pending delivery using the call:
sigpending(mask);
result sigset_t *mask;
.DE
.Sh 3 "Signal stacks
.Sh 3 14 "Signal stacks
.LP
Applications that maintain complex or fixed size stacks can use
the call:

View File

@ -1,4 +1,4 @@
.\" $NetBSD: 1.4.t,v 1.3 2003/08/07 10:30:48 agc Exp $
.\" $NetBSD: 1.4.t,v 1.4 2013/10/06 05:45:19 dholland Exp $
.\"
.\" Copyright (c) 1983, 1993, 1994
.\" The Regents of the University of California. All rights reserved.
@ -29,8 +29,8 @@
.\"
.\" @(#)1.4.t 8.5 (Berkeley) 5/29/94
.\"
.Sh 2 "Timers
.Sh 3 "Real time
.Sh 2 14 "Timers
.Sh 3 14 "Real time
.PP
The system's notion of the current time is in Coordinated Universal Time
(UTC, previously GMT) and the current time
@ -88,7 +88,7 @@ by skewing the rate at which time advances:
adjtime(delta, olddelta);
struct timeval *delta; result struct timeval *olddelta;
.DE
.Sh 3 "Interval time
.Sh 3 15 "Interval time
.LP
The system provides each process with three interval timers,
defined in \fI<sys/time.h>\fP:

View File

@ -1,4 +1,4 @@
.\" $NetBSD: 1.5.t,v 1.3 2003/08/07 10:30:49 agc Exp $
.\" $NetBSD: 1.5.t,v 1.4 2013/10/06 05:45:19 dholland Exp $
.\"
.\" Copyright (c) 1983, 1993, 1994
.\" The Regents of the University of California. All rights reserved.
@ -29,8 +29,8 @@
.\"
.\" @(#)1.5.t 8.6 (Berkeley) 5/29/94
.\"
.Sh 2 Descriptors
.Sh 3 "The reference table
.Sh 2 16 "Descriptors
.Sh 3 16 "The reference table
.PP
Each process has access to resources through
\fIdescriptors\fP. Each descriptor is a handle allowing
@ -59,7 +59,7 @@ The maximum number of descriptors is a resource limit (see section
The entries in the descriptor reference
table are referred to by small integers; for example if there
are 64 slots they are numbered 0 to 63.
.Sh 3 "Descriptor properties
.Sh 3 16 "Descriptor properties
.PP
Each descriptor has a logical set of properties maintained
by the system and defined by its \fItype\fP.
@ -78,7 +78,7 @@ Section
describes communications domains and sockets.
Terminals and (structured and unstructured) devices are described in section
.Xr 2.4 .
.Sh 3 "Managing descriptor references
.Sh 3 16 "Managing descriptor references
.LP
A duplicate of a descriptor reference may be made by doing:
.DS
@ -109,7 +109,7 @@ Descriptors are deallocated by:
close(old);
int old;
.DE
.Sh 3 "Multiplexing requests
.Sh 3 16 "Multiplexing requests
.PP
The system provides a
standard way to do

View File

@ -1,4 +1,4 @@
.\" $NetBSD: 1.6.t,v 1.4 2003/08/07 10:30:49 agc Exp $
.\" $NetBSD: 1.6.t,v 1.5 2013/10/06 05:45:19 dholland Exp $
.\"
.\" Copyright (c) 1983, 1993, 1994
.\" The Regents of the University of California. All rights reserved.
@ -29,8 +29,8 @@
.\"
.\" @(#)1.6.t 8.5 (Berkeley) 6/1/94
.\"
.Sh 2 "Resource controls
.Sh 3 "Process priorities
.Sh 2 18 "Resource controls
.Sh 3 18 "Process priorities
.PP
The system gives CPU scheduling priority to processes that have not used
CPU time recently. This tends to favor interactive processes and
@ -65,7 +65,7 @@ The
call sets the priorities of all the
specified processes to the specified value.
Only the super-user may lower priorities.
.Sh 3 "Resource utilization
.Sh 3 18 "Resource utilization
.PP
The
.Fn getrusage
@ -102,7 +102,7 @@ struct rusage {
};
.TE
.DE
.Sh 3 "Resource limits
.Sh 3 19 "Resource limits
.PP
The resources of a process for which limits are controlled by the
kernel are defined in \fI<sys/resource.h>\fP, and controlled by the

View File

@ -1,4 +1,4 @@
.\" $NetBSD: 1.7.t,v 1.3 2003/08/07 10:30:49 agc Exp $
.\" $NetBSD: 1.7.t,v 1.4 2013/10/06 05:45:19 dholland Exp $
.\"
.\" Copyright (c) 1983, 1993, 1994
.\" The Regents of the University of California. All rights reserved.
@ -29,11 +29,11 @@
.\"
.\" @(#)1.7.t 8.4 (Berkeley) 5/26/94
.\"
.Sh 2 "System operation support
.Sh 2 19 "System operation support
.LP
Unless noted otherwise,
the calls in this section are permitted only to a privileged user.
.Sh 3 "Monitoring system operation
.Sh 3 20 "Monitoring system operation
.PP
The
.Fn sysctl
@ -101,7 +101,7 @@ CTL\_USER sys/sysctl.h User-level
CTL\_VM vm/vm_param.h Virtual memory
.TE
.DE
.Sh 3 "Bootstrap operations
.Sh 3 20 "Bootstrap operations
.LP
The call:
.DS
@ -137,7 +137,7 @@ swapon(blkdev);
char *blkdev;
.DE
specifies a device to be made available for paging and swapping.
.Sh 3 "Shutdown operations
.Sh 3 21 "Shutdown operations
.LP
The call:
.DS
@ -171,7 +171,7 @@ 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, among other options.
These constants are defined in \fI<sys/reboot.h>\fP.
.Sh 3 "Accounting
.Sh 3 21 "Accounting
.PP
The system optionally keeps an accounting record in a file
for each process that exits on the system.

View File

@ -1,4 +1,4 @@
.\" $NetBSD: 2.0.t,v 1.3 2003/08/07 10:30:49 agc Exp $
.\" $NetBSD: 2.0.t,v 1.4 2013/10/06 05:45:19 dholland Exp $
.\"
.\" Copyright (c) 1983, 1993, 1994
.\" The Regents of the University of California. All rights reserved.
@ -29,7 +29,7 @@
.\"
.\" @(#)2.0.t 8.4 (Berkeley) 5/26/94
.\"
.Sh 1 "System facilities
.Sh 1 21 "System facilities
.LP
The system abstractions described are:
.IP "Directory contexts

View File

@ -1,4 +1,4 @@
.\" $NetBSD: 2.1.t,v 1.3 2003/08/07 10:30:49 agc Exp $
.\" $NetBSD: 2.1.t,v 1.4 2013/10/06 05:45:19 dholland Exp $
.\"
.\" Copyright (c) 1983, 1993, 1994
.\" The Regents of the University of California. All rights reserved.
@ -29,7 +29,7 @@
.\"
.\" @(#)2.1.t 8.4 (Berkeley) 5/26/94
.\"
.Sh 2 "Generic operations
.Sh 2 22 "Generic operations
.PP
Many system abstractions support the
.Fn read ,
@ -41,7 +41,7 @@ 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
common to all system-defined abstractions and are described here.
.Sh 3 "Read and write
.Sh 3 22 "Read and write
.PP
The
.Fn read
@ -112,7 +112,7 @@ cc = writev(fd, iov, 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
.Sh 3 23 "Input/output control
.LP
Control operations on an object are performed by the
.Fn ioctl
@ -137,7 +137,7 @@ disks cause formatting operations to occur; operations on tapes
control tape positioning.
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
.Sh 3 23 "Non-blocking and asynchronous operations
.PP
A process that wishes to do non-blocking operations on one of
its descriptors sets the descriptor in non-blocking mode as

View File

@ -1,4 +1,4 @@
.\" $NetBSD: 2.2.t,v 1.4 2003/08/07 10:30:49 agc Exp $
.\" $NetBSD: 2.2.t,v 1.5 2013/10/06 05:45:19 dholland Exp $
.\"
.\" Copyright (c) 1983, 1993, 1994
.\" The Regents of the University of California. All rights reserved.
@ -30,8 +30,8 @@
.\" @(#)2.2.t 8.8 (Berkeley) 6/1/94
.\"
.ne 1i
.Sh 2 "Filesystem
.Sh 3 "Overview
.Sh 2 23 "Filesystem
.Sh 3 23 "Overview
.PP
The filesystem abstraction provides access to a hierarchical
filesystem structure.
@ -47,7 +47,7 @@ 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.
.Sh 3 "Naming
.Sh 3 23 "Naming
.PP
The filesystem calls take \fIpath name\fP arguments.
These consist of a zero or more component \fIfile names\fP
@ -101,11 +101,11 @@ char *path; struct statfs *buf;
fstatfs(fd, buf);
int fd; struct statfs *buf;
.DE
.Sh 3 "Creation and removal
.Sh 3 24 "Creation and removal
.PP
The filesystem allows directories, files, special devices,
and fifos to be created and removed from the filesystem.
.Sh 4 "Directory creation and removal
.Sh 4 24 "Directory creation and removal
.LP
A directory is created with the
.Fn mkdir
@ -148,7 +148,7 @@ which provide a more convenient interface than
.Fn getdirentries .
The \fIfts\fP package is provided
for recursive directory traversal.
.Sh 4 "File creation
.Sh 4 24 "File creation
.LP
Files are opened and/or created with the
.Fn open
@ -255,7 +255,7 @@ style locks.
The O_ASYNC flag enables the SIGIO signal to be sent to
the process group of the opening process when I/O is possible,
e.g., upon availability of data to be read.
.Sh 4 "Creating references to devices
.Sh 4 26 "Creating references to devices
.PP
The filesystem allows entries which reference peripheral devices.
Peripherals are distinguished as \fIblock\fP or \fIcharacter\fP
@ -292,7 +292,7 @@ char *path; mode_t mode;
.DE
The \fImode\fP parameter is used solely to specify the access
permissions of the newly created fifo.
.Sh 4 "Links and renaming
.Sh 4 26 "Links and renaming
.PP
Links allow multiple names for a file to exist.
Links exist independently of the file to which they are linked.
@ -374,7 +374,7 @@ 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
.Sh 4 27 "File, device, and fifo removal
.LP
A reference to a file, special device or fifo may be removed with the
.Fn unlink
@ -415,7 +415,7 @@ This call is most useful for revoking access to a terminal line after
a hangup in preparation for reuse by a new login session.
Access to a controlling terminal is automatically revoked
when the session leader for the session exits.
.Sh 3 "Reading and modifying file attributes
.Sh 3 27 "Reading and modifying file attributes
.LP
Detailed information about the attributes of a file
may be obtained with the calls:
@ -518,7 +518,7 @@ char *path; struct timeval *tvp[2];
.DE
This is particularly useful when moving files between media,
to preserve file access and modification times.
.Sh 3 "Checking accessibility
.Sh 3 28 "Checking accessibility
.PP
A process running with
different real and effective user-ids
@ -572,7 +572,7 @@ the \fIfd\fP argument is an open file descriptor.
The \fIname\fP argument specifies the system variable to be queried.
Symbolic constants for each name value are found in the include file
\fI<unistd.h>\fP.
.Sh 3 "Extension and truncation
.Sh 3 29 "Extension and truncation
.PP
Files are created with zero length and may be extended
simply by writing or appending to them. While a file is
@ -634,7 +634,7 @@ 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 continuing.
.Sh 3 "Locking
.Sh 3 29 "Locking
.PP
The filesystem provides basic facilities that allow cooperating processes
to synchronize their access to shared files. A process may
@ -684,7 +684,7 @@ in the \fIhow\fP parameter.
Specifying LOCK_UN removes all locks associated with the descriptor.
Advisory locks held by a process are automatically deleted when
the process terminates.
.Sh 3 "Disk quotas
.Sh 3 30 "Disk quotas
.PP
As an optional facility, each local filesystem can impose limits on a
user's or group's disk usage.
@ -722,7 +722,7 @@ Q_SETUSE /* set usage */
Q_SYNC /* sync disk copy of a filesystems quotas */
.TE
.DE
.Sh 3 "Remote filesystems
.Sh 3 30 "Remote filesystems
.LP
There are two system calls intended to help support the remote filesystem
implementation.
@ -749,7 +749,7 @@ file handle pointed to by fhp.
This file handle can then be used in future calls to NFS to access
the file without the need to repeat the pathname translation.
This system call is restricted to the superuser.
.Sh 3 "Other filesystems
.Sh 3 31 "Other filesystems
.LP
The kernel supports many other filesystems.
These include:

View File

@ -1,4 +1,4 @@
.\" $NetBSD: 2.3.t,v 1.4 2010/01/28 14:05:03 mbalmer Exp $
.\" $NetBSD: 2.3.t,v 1.5 2013/10/06 05:45:19 dholland Exp $
.\"
.\" Copyright (c) 1983, 1993, 1994
.\" The Regents of the University of California. All rights reserved.
@ -29,9 +29,9 @@
.\"
.\" @(#)2.3.t 8.6 (Berkeley) 6/1/94
.\"
.Sh 2 "Interprocess communications
.Sh 3 "Interprocess communication primitives
.Sh 4 "Communication domains
.Sh 2 31 "Interprocess communications
.Sh 3 31 "Interprocess communication primitives
.Sh 4 31 "Communication domains
.PP
The system provides access to an extensible set of
communication \fIdomains\fP. A communication domain (or protocol family)
@ -45,7 +45,7 @@ a check-off box on the list of your system capabilities,
and the ``NS'' domain (PF_NS) for communication
using the Xerox Network Systems protocols.
Other domains can be added to the system.
.Sh 4 "Socket types and protocols
.Sh 4 31 "Socket types and protocols
.PP
Within a domain, communication takes place between communication endpoints
known as \fIsockets\fP. Each socket has the potential to exchange
@ -106,7 +106,7 @@ For example, within the ``Internet'' domain, the SOCK_DGRAM type may be
implemented by the UDP user datagram protocol, and the SOCK_STREAM
type may be implemented by the TCP transmission control protocol, while
no standard protocols to provide SOCK_RDM or SOCK_SEQPACKET sockets exist.
.Sh 4 "Socket creation, naming and service establishment
.Sh 4 32 "Socket creation, naming and service establishment
.PP
Sockets may be \fIconnected\fP or \fIunconnected\fP. An unconnected
socket descriptor is obtained by the
@ -161,7 +161,7 @@ getpeername(s, name, namelen);
int s; result struct sockaddr *name; result int *namelen;
.DE
Domains may support sockets with several names.
.Sh 4 "Accepting connections
.Sh 4 33 "Accepting connections
.LP
Once a binding is made to a connection-oriented socket,
it is possible to
@ -189,7 +189,7 @@ If no new connections are queued for acceptance,
the call will wait for a connection unless
non-blocking I/O has been enabled (see section
.Xr 1.5.4 ).
.Sh 4 "Making connections
.Sh 4 33 "Making connections
.LP
An active connection to a named socket is made by the
.Fn connect
@ -237,7 +237,7 @@ result int pv[2];
.DE
creates a pair of SOCK_STREAM sockets in the PF_LOCAL domain,
with pv[0] only writable and pv[1] only readable.
.Sh 4 "Sending and receiving data
.Sh 4 33 "Sending and receiving data
.LP
Messages may be sent from a socket by:
.DS
@ -294,7 +294,7 @@ MSG_WAITALL /* wait for full request or error */
MSG_DONTWAIT /* this message should be nonblocking */
.TE
.DE
.Sh 4 "Scatter/gather and exchanging access rights
.Sh 4 34 "Scatter/gather and exchanging access rights
.PP
It is possible to scatter and gather data and to exchange access rights
with messages. When either of these operations is involved,
@ -370,7 +370,7 @@ int s; struct msghdr *msg; int flags;
msglen = recvmsg(s, msg, flags);
result int msglen; int s; result struct msghdr *msg; int flags;
.DE
.Sh 4 "Using read and write with sockets
.Sh 4 35 "Using read and write with sockets
.PP
The normal
.Fn read
@ -384,7 +384,7 @@ calls from or to a single area of memory and discarding any rights
received. A process may operate on a virtual circuit socket, a terminal
or a file with blocking or non-blocking input/output
operations without distinguishing the descriptor type.
.Sh 4 "Shutting down halves of full-duplex connections
.Sh 4 35 "Shutting down halves of full-duplex connections
.PP
A process that has a full-duplex socket such as a virtual circuit
and no longer wishes to read from or write to this socket can
@ -400,7 +400,7 @@ If the underlying protocol supports unidirectional or bidirectional shutdown,
this indication will be passed to the peer.
For example, a shutdown for writing might produce an end-of-file
condition at the remote end.
.Sh 4 "Socket and protocol options
.Sh 4 35 "Socket and protocol options
.PP
Sockets, and their underlying communication protocols, may
support \fIoptions\fP. These options may be used to manipulate
@ -429,32 +429,32 @@ by the socket facilities. Other \fIlevel\fP values indicate
a particular protocol which is to act on the option request;
these values are normally interpreted as a ``protocol number''
within the protocol family.
.Sh 3 "PF_LOCAL domain
.Sh 3 36 "PF_LOCAL domain
.PP
This section describes briefly the properties of the PF_LOCAL (``UNIX'')
communications domain.
.Sh 4 "Types of sockets
.Sh 4 36 "Types of sockets
.PP
In the local domain,
the SOCK_STREAM abstraction provides pipe-like
facilities, while SOCK_DGRAM provides (usually)
reliable message-style communications.
.Sh 4 "Naming
.Sh 4 36 "Naming
.PP
Socket names are strings and may appear in the filesystem
name space.
.Sh 4 "Access rights transmission
.Sh 4 36 "Access rights transmission
.PP
The ability to pass descriptors with messages in this domain
allows migration of service within the system and allows
user processes to be used in building system facilities.
.Sh 3 "INTERNET domain
.Sh 3 36 "INTERNET domain
.PP
This section describes briefly how the Internet domain is
mapped to the model described in this section. More
information will be found in the document describing the
network implementation in 4.4BSD (SMM:18).
.Sh 4 "Socket types and protocols
.Sh 4 36 "Socket types and protocols
.PP
SOCK_STREAM is supported by the Internet TCP protocol;
SOCK_DGRAM by the UDP protocol.
@ -465,7 +465,7 @@ The SOCK_SEQPACKET
has no direct Internet family analogue; a protocol
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
.Sh 4 36 "Socket naming
.PP
Sockets in the Internet domain have names composed of a 32-bit
Internet address and a 16-bit port number.
@ -476,10 +476,10 @@ 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 the subnet; this is enabled by setting a network address
mask at boot time.
.Sh 4 "Access rights transmission
.Sh 4 36 "Access rights transmission
.PP
No access rights transmission facilities are provided in the Internet domain.
.Sh 4 "Raw access
.Sh 4 36 "Raw access
.PP
The Internet domain allows the super-user access to the raw facilities
of IP.

View File

@ -1,4 +1,4 @@
.\" $NetBSD: 2.4.t,v 1.3 2003/08/07 10:30:49 agc Exp $
.\" $NetBSD: 2.4.t,v 1.4 2013/10/06 05:45:19 dholland Exp $
.\"
.\" Copyright (c) 1983, 1993, 1994
.\" The Regents of the University of California. All rights reserved.
@ -29,8 +29,8 @@
.\"
.\" @(#)2.4.t 8.5 (Berkeley) 6/1/94
.\"
.Sh 2 "Terminals and Devices
.Sh 3 "Terminals
.Sh 2 37 "Terminals and Devices
.Sh 3 37 "Terminals
.PP
Terminals support
.Fn read
@ -62,7 +62,7 @@ int fd;
.DE
Only a session leader may acquire a controlling terminal.
.ne 1i
.Sh 4 "Terminal input
.Sh 4 37 "Terminal input
.PP
Terminals are handled according to the underlying communication
characteristics such as baud rate and required delays,
@ -145,7 +145,7 @@ and SIGQUIT signals,
and to stop a process group
with the SIGTSTP signal either immediately, or when
all input up to the stop character has been read.
.Sh 4 "Terminal output
.Sh 4 38 "Terminal output
.PP
On output, the terminal handler provides some simple formatting services.
These include converting the carriage return character to the
@ -153,7 +153,7 @@ two character return-linefeed sequence,
inserting delays after certain standard control characters,
and expanding tabs.
.pl +1
.Sh 3 "Structured devices
.Sh 3 38 "Structured devices
.PP
Structured devices are typified by disks and magnetic
tapes, but may represent any random-access device.
@ -162,7 +162,7 @@ devices to allow them to be read and written in random access
fashion like ordinary files.
Filesystems are normally mounted on block devices.
.pl -1
.Sh 3 "Unstructured devices
.Sh 3 38 "Unstructured devices
.PP
Unstructured devices are those devices which
do not support block structure. Familiar unstructured devices

View File

@ -1,4 +1,4 @@
.\" $NetBSD: 2.5.t,v 1.3 2003/08/07 10:30:49 agc Exp $
.\" $NetBSD: 2.5.t,v 1.4 2013/10/06 05:45:19 dholland Exp $
.\"
.\" Copyright (c) 1983, 1993, 1994
.\" The Regents of the University of California. All rights reserved.
@ -29,8 +29,8 @@
.\"
.\" @(#)2.5.t 8.6 (Berkeley) 5/29/94
.\"
.Sh 2 "Process debugging
.Sh 3 "Traditional debugging
.Sh 2 38 "Process debugging
.Sh 3 38 "Traditional debugging
.LP
Debuggers traditionally use the
.Fn ptrace
@ -73,7 +73,7 @@ The debugger finds (or creates) the process that it wants to
debug and then issues an attach command via the \fIctl\fP file.
Further interaction can then be done with the process through
the other files provided by the \fI/proc\fP filesystem.
.Sh 3 "Kernel tracing
.Sh 3 38 "Kernel tracing
.LP
Another facility for debugging programs is provided by the
.Fn ktrace

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.7 2003/07/10 10:34:30 lukem Exp $
# $NetBSD: Makefile,v 1.8 2013/10/06 05:45:19 dholland Exp $
#
# @(#)Makefile 8.2 (Berkeley) 6/1/94
@ -6,13 +6,20 @@ DIR= psd/05.sysman
SRCS= 0.t 1.0.t 1.1.t 1.2.t 1.3.t 1.4.t 1.5.t 1.6.t 1.7.t \
2.0.t 2.1.t 2.2.t 2.3.t 2.4.t 2.5.t a.t
MACROS= -ms
CLEANFILES+=Toc
CLEANFILES+=facilities contents pagelog
paper.ps: ${SRCS}
# Format twice to (only) generate Toc in the first run:
( ${TOOL_SOELIM} -I${.CURDIR} ${.ALLSRC} | ${TOOL_TBL} | \
${TOOL_ROFF_PS} ${MACROS} 2>&1 ) >/dev/null
${TOOL_SOELIM} -I${.CURDIR} ${.ALLSRC} | ${TOOL_TBL} | \
paper.ps: ${SRCS} facilities contents
${TOOL_SOELIM} -I${.CURDIR} ${.ALLSRC:M*.t} | ${TOOL_TBL} | \
${TOOL_ROFF_PS} ${MACROS} > ${.TARGET}
facilities: ${SRCS}
${TOOL_SOELIM} -I${.CURDIR} ${.ALLSRC} |\
${TOOL_SED} -n -e '/^\.Fd/p;/^\.Sh/p' |\
${TOOL_SED} -e 's/^\.Fd/.Nm/;s/^\.Sh /.L/' > ${.TARGET}
contents: ${SRCS}
${TOOL_SOELIM} -I${.CURDIR} ${.ALLSRC} |\
${TOOL_SED} -n -e '/^\.Sh/p' |\
${TOOL_SED} -e 's/^\.Sh /.L/;s/$$/"/' > ${.TARGET}
.include <bsd.doc.mk>

View File

@ -1,4 +1,4 @@
.\" $NetBSD: a.t,v 1.4 2003/08/07 10:30:49 agc Exp $
.\" $NetBSD: a.t,v 1.5 2013/10/06 05:45:19 dholland Exp $
.\"
.\" Copyright (c) 1983, 1993
.\" The Regents of the University of California. All rights reserved.
@ -41,14 +41,14 @@
.nr l3 0
.nr l4 0
.sp 0.5
\\n(l1 \fB\\$1\fP
\\n(l1 \fB\\$2\fP
..
.de L2
.nr l2 +1
.nr l3 0
.nr l4 0
.sp 0.25
\\n(l1.\\n(l2 \fB\\$1\fP
\\n(l1.\\n(l2 \fB\\$2\fP
..
.de L3
..
@ -59,10 +59,10 @@
\\$1 \\$3
..
.bp
.Sh 1 "Summary of facilities
.Sh 1 40 "Summary of facilities
.sp 1
.ta \w'8.8\ \ 'u +0.25i +\w'gettimeofday\ \ 'u
'so Toc
'so facilities
.pn 2
.bp
.de L0
@ -71,7 +71,7 @@
.nr l3 0
.nr l4 0
.br
\fB\\$1\fP \\$2
\fB\\$2\fP \\$1
..
.de L1
.nr l1 +1
@ -79,25 +79,25 @@
.nr l3 0
.nr l4 0
.sp 0.5
\\n(l1 \fB\\$1\fP \\$2
\\n(l1 \fB\\$2\fP \\$1
..
.de L2
.nr l2 +1
.nr l3 0
.nr l4 0
.sp 0.25
\\n(l1.\\n(l2 \fB\\$1\fP \\$2
\\n(l1.\\n(l2 \fB\\$2\fP \\$1
..
.de L3
.nr l3 +1
.nr l4 0
.br
\\n(l1.\\n(l2.\\n(l3 \\$1 \\$2
\\n(l1.\\n(l2.\\n(l3 \\$2 \\$1
..
.de L4
.nr l4 +1
.br
\\n(l1.\\n(l2.\\n(l3.\\n(l4 \\$1 \\$2
\\n(l1.\\n(l2.\\n(l3.\\n(l4 \\$2 \\$1
..
.de Nm
..
@ -105,5 +105,5 @@
\s+4\fBContents\fP\s0
.sp 2
.ta \w'8.8.8.88\ \ 'uR +\w'\ \ \ 'u 6iR
'so Toc
.sy mv toc Toc
'so contents