summaryrefslogtreecommitdiff
path: root/share/man/man5
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1995-10-18 08:53:40 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1995-10-18 08:53:40 +0000
commitd6583bb2a13f329cf0332ef2570eb8bb8fc0e39c (patch)
treeece253b876159b39c620e62b6c9b1174642e070e /share/man/man5
initial import of NetBSD tree
Diffstat (limited to 'share/man/man5')
-rw-r--r--share/man/man5/Makefile12
-rw-r--r--share/man/man5/a.out.5455
-rw-r--r--share/man/man5/acct.5112
-rw-r--r--share/man/man5/core.5113
-rw-r--r--share/man/man5/dir.5153
-rw-r--r--share/man/man5/disktab.5144
-rw-r--r--share/man/man5/ethers.540
-rw-r--r--share/man/man5/fs.5344
-rw-r--r--share/man/man5/fstab.5238
-rw-r--r--share/man/man5/group.5149
-rw-r--r--share/man/man5/hosts.5111
-rw-r--r--share/man/man5/link.5577
-rw-r--r--share/man/man5/motd.538
-rw-r--r--share/man/man5/netgroup.5112
-rw-r--r--share/man/man5/networks.590
-rw-r--r--share/man/man5/passwd.5239
-rw-r--r--share/man/man5/phones.578
-rw-r--r--share/man/man5/printcap.5290
-rw-r--r--share/man/man5/protocols.579
-rw-r--r--share/man/man5/remote.5202
-rw-r--r--share/man/man5/resolv.conf.5224
-rw-r--r--share/man/man5/rpc.575
-rw-r--r--share/man/man5/services.587
-rw-r--r--share/man/man5/shells.567
-rw-r--r--share/man/man5/stab.5224
-rw-r--r--share/man/man5/types.5149
-rw-r--r--share/man/man5/utmp.5220
27 files changed, 4622 insertions, 0 deletions
diff --git a/share/man/man5/Makefile b/share/man/man5/Makefile
new file mode 100644
index 00000000000..dbe98968187
--- /dev/null
+++ b/share/man/man5/Makefile
@@ -0,0 +1,12 @@
+# $NetBSD: Makefile,v 1.14 1995/05/11 23:13:15 cgd Exp $
+# @(#)Makefile 8.1 (Berkeley) 6/5/93
+
+# missing: dump.5 plot.5
+
+MAN= a.out.5 acct.5 core.5 dir.5 disktab.5 ethers.5 fs.5 fstab.5 group.5 \
+ hosts.5 link.5 motd.5 netgroup.5 networks.5 passwd.5 phones.5 \
+ printcap.5 protocols.5 remote.5 resolv.conf.5 rpc.5 services.5 \
+ shells.5 stab.5 types.5 utmp.5
+MLINKS= dir.5 dirent.5 fs.5 inode.5 utmp.5 wtmp.5 utmp.5 lastlog.5
+
+.include <bsd.prog.mk>
diff --git a/share/man/man5/a.out.5 b/share/man/man5/a.out.5
new file mode 100644
index 00000000000..202c2bfef5b
--- /dev/null
+++ b/share/man/man5/a.out.5
@@ -0,0 +1,455 @@
+.\" $NetBSD: a.out.5,v 1.8 1994/11/30 19:31:09 jtc Exp $
+.\"
+.\" Copyright (c) 1991, 1993
+.\" The Regents of the University of California. All rights reserved.
+.\"
+.\" This man page is derived from documentation contributed to Berkeley by
+.\" Donn Seeley at UUNET Technologies, Inc.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\" must display the following acknowledgement:
+.\" This product includes software developed by the University of
+.\" California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" @(#)a.out.5 8.1 (Berkeley) 6/5/93
+.\"
+.Dd June 5, 1993
+.Dt A.OUT 5
+.Os
+.Sh NAME
+.Nm a.out
+.Nd format of executable binary files
+.Sh SYNOPSIS
+.Fd #include <a.out.h>
+.Sh DESCRIPTION
+The include file
+.Aq Pa a.out.h
+declares three structures and several macros.
+The structures describe the format of
+executable machine code files
+.Pq Sq binaries
+on the system.
+.Pp
+A binary file consists of up to 7 sections.
+In order, these sections are:
+.Bl -tag -width "text relocations"
+.It exec header
+Contains parameters used by the kernel
+to load a binary file into memory and execute it,
+and by the link editor
+.Xr ld 1
+to combine a binary file with other binary files.
+This section is the only mandatory one.
+.It text segment
+Contains machine code and related data
+that are loaded into memory when a program executes.
+May be loaded read-only.
+.It data segment
+Contains initialized data; always loaded into writable memory.
+.It text relocations
+Contains records used by the link editor
+to update pointers in the text segment when combining binary files.
+.It data relocations
+Like the text relocation section, but for data segment pointers.
+.It symbol table
+Contains records used by the link editor
+to cross reference the addresses of named variables and functions
+.Pq Sq symbols
+between binary files.
+.It string table
+Contains the character strings corresponding to the symbol names.
+.El
+.Pp
+Every binary file begins with an
+.Fa exec
+structure:
+.Bd -literal -offset indent
+struct exec {
+ unsigned long a_midmag;
+ unsigned long a_text;
+ unsigned long a_data;
+ unsigned long a_bss;
+ unsigned long a_syms;
+ unsigned long a_entry;
+ unsigned long a_trsize;
+ unsigned long a_drsize;
+};
+.Ed
+.Pp
+The fields have the following functions:
+.Bl -tag -width a_trsize
+.It Fa a_midmag
+This field is stored in network byte-order so that binaries for
+for machines with alternate byte orders can be distinguished.
+It has a number of sub-components accessed by the macros
+.Dv N_GETFLAG() ,
+.Dv N_GETMID() , and
+.Dv N_GETMAGIC() ,
+and set by the macro
+.Dv N_SETMAGIC().
+.Pp
+The macro
+.Dv N_GETFLAG()
+returns a few flags:
+.Bl -tag -width EX_DYNAMIC
+.It Dv EX_DYNAMIC
+indicates that the executable requires the services of the run-time link editor.
+.It Dv EX_PIC
+indicates that the object contains position independent code. This flag is
+set by
+.Xr as 1
+when given the
+.Sq -k
+flag and is preserved by
+.Xr ld 1
+if necessary.
+.El
+.Pp
+If both EX_DYNAMIC and EX_PIC are set, the object file is a position indendent
+executable image (eg. a shared library), which is to be loaded into the
+process address space by the run-time link editor.
+.Pp
+The macro
+.Dv N_GETMID()
+returns the machine-id.
+This indicates which machine(s) the binary is intended to run on.
+.Pp
+.Dv N_GETMAGIC()
+specifies the magic number, which uniquely identifies binary files
+and distinguishes different loading conventions.
+The field must contain one of the following values:
+.Bl -tag -width ZMAGIC
+.It Dv OMAGIC
+The text and data segments immediately follow the header
+and are contiguous.
+The kernel loads both text and data segments into writable memory.
+.It Dv NMAGIC
+As with
+.Dv OMAGIC ,
+text and data segments immediately follow the header and are contiguous.
+However, the kernel loads the text into read-only memory
+and loads the data into writable memory at the next
+page boundary after the text.
+.It Dv ZMAGIC
+The kernel loads individual pages on demand from the binary.
+The header, text segment and data segment are all
+padded by the link editor to a multiple of the page size.
+Pages that the kernel loads from the text segment are read-only,
+while pages from the data segment are writable.
+.El
+.It Fa a_text
+Contains the size of the text segment in bytes.
+.It Fa a_data
+Contains the size of the data segment in bytes.
+.It Fa a_bss
+Contains the number of bytes in the
+.Sq bss segment
+and is used by the kernel to set the initial break
+.Pq Xr brk 2
+after the data segment.
+The kernel loads the program so that this amount of writable memory
+appears to follow the data segment and initially reads as zeroes.
+.It Fa a_syms
+Contains the size in bytes of the symbol table section.
+.It Fa a_entry
+Contains the address in memory of the entry point
+of the program after the kernel has loaded it;
+the kernel starts the execution of the program
+from the machine instruction at this address.
+.It Fa a_trsize
+Contains the size in bytes of the text relocation table.
+.It Fa a_drsize
+Contains the size in bytes of the data relocation table.
+.El
+.Pp
+The
+.Pa a.out.h
+include file defines several macros which use an
+.Fa exec
+structure to test consistency or to locate section offsets in the binary file.
+.Bl -tag -width N_BADMAG(exec)
+.It Fn N_BADMAG exec
+Nonzero if the
+.Fa a_magic
+field does not contain a recognized value.
+.It Fn N_TXTOFF exec
+The byte offset in the binary file of the beginning of the text segment.
+.It Fn N_SYMOFF exec
+The byte offset of the beginning of the symbol table.
+.It Fn N_STROFF exec
+The byte offset of the beginning of the string table.
+.El
+.Pp
+Relocation records have a standard format which
+is described by the
+.Fa relocation_info
+structure:
+.Bd -literal -offset indent
+struct relocation_info {
+ int r_address;
+ unsigned int r_symbolnum : 24,
+ r_pcrel : 1,
+ r_length : 2,
+ r_extern : 1,
+ r_baserel : 1,
+ r_jmptable : 1,
+ r_relative : 1,
+ r_copy : 1;
+};
+.Ed
+.Pp
+The
+.Fa relocation_info
+fields are used as follows:
+.Bl -tag -width r_symbolnum
+.It Fa r_address
+Contains the byte offset of a pointer that needs to be link-edited.
+Text relocation offsets are reckoned from the start of the text segment,
+and data relocation offsets from the start of the data segment.
+The link editor adds the value that is already stored at this offset
+into the new value that it computes using this relocation record.
+.It Fa r_symbolnum
+Contains the ordinal number of a symbol structure
+in the symbol table (it is
+.Em not
+a byte offset).
+After the link editor resolves the absolute address for this symbol,
+it adds that address to the pointer that is undergoing relocation.
+(If the
+.Fa r_extern
+bit is clear, the situation is different; see below.)
+.It Fa r_pcrel
+If this is set,
+the link editor assumes that it is updating a pointer
+that is part of a machine code instruction using pc-relative addressing.
+The address of the relocated pointer is implicitly added
+to its value when the running program uses it.
+.It Fa r_length
+Contains the log base 2 of the length of the pointer in bytes;
+0 for 1-byte displacements, 1 for 2-byte displacements,
+2 for 4-byte displacements.
+.It Fa r_extern
+Set if this relocation requires an external reference;
+the link editor must use a symbol address to update the pointer.
+When the
+.Fa r_extern
+bit is clear, the relocation is
+.Sq local ;
+the link editor updates the pointer to reflect
+changes in the load addresses of the various segments,
+rather than changes in the value of a symbol (except when
+.Fa r_baserel
+is also set (see below).
+In this case, the content of the
+.Fa r_symbolnum
+field is an
+.Fa n_type
+value (see below);
+this type field tells the link editor
+what segment the relocated pointer points into.
+.It Fa r_baserel
+If set, the symbol, as identified by the
+.Fa r_symbolnum
+field, is to be relocated to an offset into the Global Offset Table.
+At run-time, the entry in the Global Offset Table at this offset is set to
+be the address of the symbol.
+.It Fa r_jmptable
+If set, the symbol, as identified by the
+.Fa r_symbolnum
+field, is to be relocated to an offset into the Procedure Linkage Table.
+.It Fa r_relative
+If set, this relocation is relative to the (run-time) load address of the
+image this object file is going to be a part of. This type of relocation
+only occurs in shared objects.
+.It Fa r_copy
+If set, this relocation record identifies a symbol whose contents should
+be copied to the location given in
+.Fa r_address.
+The copying is done by the run-time link-editor from a suitable data
+item in a shared object.
+.El
+.Pp
+Symbols map names to addresses (or more generally, strings to values).
+Since the link-editor adjusts addresses,
+a symbol's name must be used to stand for its address
+until an absolute value has been assigned.
+Symbols consist of a fixed-length record in the symbol table
+and a variable-length name in the string table.
+The symbol table is an array of
+.Fa nlist
+structures:
+.Bd -literal -offset indent
+struct nlist {
+ union {
+ char *n_name;
+ long n_strx;
+ } n_un;
+ unsigned char n_type;
+ char n_other;
+ short n_desc;
+ unsigned long n_value;
+};
+.Ed
+.Pp
+The fields are used as follows:
+.Bl -tag -width n_un.n_strx
+.It Fa n_un.n_strx
+Contains a byte offset into the string table
+for the name of this symbol.
+When a program accesses a symbol table with the
+.Xr nlist 3
+function,
+this field is replaced with the
+.Fa n_un.n_name
+field, which is a pointer to the string in memory.
+.It Fa n_type
+Used by the link editor to determine
+how to update the symbol's value.
+The
+.Fa n_type
+field is broken down into three sub-fields using bitmasks.
+The link editor treats symbols with the
+.Dv N_EXT
+type bit set as
+.Sq external
+symbols and permits references to them from other binary files.
+The
+.Dv N_TYPE
+mask selects bits of interest to the link editor:
+.Bl -tag -width N_TEXT
+.It Dv N_UNDF
+An undefined symbol.
+The link editor must locate an external symbol with the same name
+in another binary file to determine the absolute value of this symbol.
+As a special case, if the
+.Fa n_value
+field is nonzero and no binary file in the link-edit defines this symbol,
+the link-editor will resolve this symbol to an address
+in the bss segment,
+reserving an amount of bytes equal to
+.Fa n_value .
+If this symbol is undefined in more than one binary file
+and the binary files do not agree on the size,
+the link editor chooses the greatest size found across all binaries.
+.It Dv N_ABS
+An absolute symbol.
+The link editor does not update an absolute symbol.
+.It Dv N_TEXT
+A text symbol.
+This symbol's value is a text address and
+the link editor will update it when it merges binary files.
+.It Dv N_DATA
+A data symbol; similar to
+.Dv N_TEXT
+but for data addresses.
+The values for text and data symbols are not file offsets but
+addresses; to recover the file offsets, it is necessary
+to identify the loaded address of the beginning of the corresponding
+section and subtract it, then add the offset of the section.
+.It Dv N_BSS
+A bss symbol; like text or data symbols but
+has no corresponding offset in the binary file.
+.It Dv N_FN
+A filename symbol.
+The link editor inserts this symbol before
+the other symbols from a binary file when
+merging binary files.
+The name of the symbol is the filename given to the link editor,
+and its value is the first text address from that binary file.
+Filename symbols are not needed for link-editing or loading,
+but are useful for debuggers.
+.El
+.Pp
+The
+.Dv N_STAB
+mask selects bits of interest to symbolic debuggers
+such as
+.Xr gdb 1 ;
+the values are described in
+.Xr stab 5 .
+.It Fa n_other
+This field provides information on the nature of the symbol independent of
+the symbol's location in terms of segments as determined by the
+.Fa n_type
+field. Currently, the lower 4 bits of the
+.Fa n_other
+field hold one of two values:
+.Dv AUX_FUNC
+and
+.Dv AUX_OBJECT
+.Po
+see
+.Aq Pa link.h
+for their definitions
+.Pc .
+.Dv AUX_FUNC
+associates the symbol with a callable function, while
+.Dv AUX_OBJECT
+associates the symbol with data, irrespective of their locations in
+either the text or the data segment.
+This field is intended to be used by
+.Xr ld 1
+for the construction of dynamic executables.
+.It Fa n_desc
+Reserved for use by debuggers; passed untouched by the link editor.
+Different debuggers use this field for different purposes.
+.It Fa n_value
+Contains the value of the symbol.
+For text, data and bss symbols, this is an address;
+for other symbols (such as debugger symbols),
+the value may be arbitrary.
+.El
+.Pp
+The string table consists of an
+.Em unsigned long
+length followed by null-terminated symbol strings.
+The length represents the size of the entire table in bytes,
+so its minimum value (or the offset of the first string)
+is always 4 on 32-bit machines.
+.Sh SEE ALSO
+.Xr as 1 ,
+.Xr gdb 1 ,
+.Xr ld 1 ,
+.Xr brk 2 ,
+.Xr execve 2 ,
+.Xr nlist 3 ,
+.Xr core 5 ,
+.Xr dbx 5 ,
+.Xr stab 5 ,
+.Xr link 5
+.Sh HISTORY
+The
+.Pa a.out.h
+include file appeared in
+.At v7 .
+.Sh BUGS
+Nobody seems to agree on what
+.Em bss
+stands for.
+.Pp
+New binary file formats may be supported in the future,
+and they probably will not be compatible at any level
+with this ancient format.
diff --git a/share/man/man5/acct.5 b/share/man/man5/acct.5
new file mode 100644
index 00000000000..2cea4a35ebc
--- /dev/null
+++ b/share/man/man5/acct.5
@@ -0,0 +1,112 @@
+.\" $NetBSD: acct.5,v 1.3 1994/11/30 19:31:10 jtc Exp $
+.\"
+.\" Copyright (c) 1991, 1993
+.\" The Regents of the University of California. All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\" must display the following acknowledgement:
+.\" This product includes software developed by the University of
+.\" California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" @(#)acct.5 8.1 (Berkeley) 6/5/93
+.\"
+.Dd June 5, 1993
+.Dt ACCT 5
+.Os
+.Sh NAME
+.Nm acct
+.Nd execution accounting file
+.Sh SYNOPSIS
+.Fd #include <sys/acct.h>
+.Sh DESCRIPTION
+The kernel maintains the following
+.Fa acct
+information structure for all
+processes. If a process terminates, and accounting is enabled,
+the kernel calls the
+.Xr acct 2
+function call to prepare and append the record
+to the accounting file.
+.Bd -literal
+/*
+ * Accounting structures; these use a comp_t type which is a 3 bits base 8
+ * exponent, 13 bit fraction ``floating point'' number. Units are 1/AHZ
+ * seconds.
+ */
+typedef u_short comp_t;
+
+struct acct {
+ char ac_comm[10]; /* name of command */
+ comp_t ac_utime; /* user time */
+ comp_t ac_stime; /* system time */
+ comp_t ac_etime; /* elapsed time */
+ time_t ac_btime; /* starting time */
+ uid_t ac_uid; /* user id */
+ gid_t ac_gid; /* group id */
+ short ac_mem; /* memory usage average */
+ comp_t ac_io; /* count of IO blocks */
+ dev_t ac_tty; /* controlling tty */
+#define AFORK 0x01 /* forked but not execed */
+#define ASU 0x02 /* used super-user permissions */
+#define ACOMPAT 0x04 /* used compatibility mode */
+#define ACORE 0x08 /* dumped core */
+#define AXSIG 0x10 /* killed by a signal */
+ char ac_flag; /* accounting flags */
+};
+
+/*
+ * 1/AHZ is the granularity of the data encoded in the comp_t fields.
+ * This is not necessarily equal to hz.
+ */
+#define AHZ 64
+
+#ifdef KERNEL
+struct vnode *acctp;
+#endif
+.Ed
+.Pp
+If a terminated process was created by an
+.Xr execve 2 ,
+the name of the executed file (at most ten characters of it)
+is saved in the field
+.Fa ac_comm
+and its status is saved by setting one of more of the following flags in
+.Fa ac_flag:
+.Dv AFORK ,
+.Dv ASU ,
+.Dv ACOMPAT ,
+.Dv ACORE
+and
+.Dv ASIG .
+.Sh SEE ALSO
+.Xr acct 2 ,
+.Xr execve 2 ,
+.Xr sa 8
+.Sh HISTORY
+A
+.Nm
+file format appeared in
+.At v7 .
diff --git a/share/man/man5/core.5 b/share/man/man5/core.5
new file mode 100644
index 00000000000..15af86b7dcd
--- /dev/null
+++ b/share/man/man5/core.5
@@ -0,0 +1,113 @@
+.\" $NetBSD: core.5,v 1.4 1994/11/30 19:31:11 jtc Exp $
+.\"
+.\" Copyright (c) 1980, 1991, 1993
+.\" The Regents of the University of California. All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\" must display the following acknowledgement:
+.\" This product includes software developed by the University of
+.\" California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" @(#)core.5 8.3 (Berkeley) 12/11/93
+.\"
+.Dd December 11, 1993
+.Dt CORE 5
+.Os BSD 4
+.Sh NAME
+.Nm core
+.Nd memory image file format
+.Sh SYNOPSIS
+.Fd #include <sys/param.h>
+.Sh DESCRIPTION
+A small number of signals which cause abnormal termination of a process
+also cause a record of the process's in-core state to be written
+to disk for later examination by one of the available debuggers.
+(See
+.Xr sigaction 2 . )
+This memory image is written to a file named
+.Nm programname.core
+in the working directory;
+provided the terminated process had write permission in the directory,
+and provided the abnormality did not cause
+a system crash.
+(In this event, the decision to save the core file is arbitrary, see
+.Xr savecore 8 . )
+.Pp
+The maximum size of a
+.Nm programname.core
+file is limited by
+.Xr setrlimit 2 .
+Files which would be larger than the limit are not created.
+.Pp
+The
+.Nm programname.core
+file consists of the
+.Fa u .
+area, whose size (in pages) is
+defined by the
+.Dv UPAGES
+manifest in the
+.Aq Pa sys/param.h
+file. The
+.Fa u .
+area starts with a
+.Fa user
+structure as given in
+.Aq Pa sys/user.h .
+The remainder of the
+.Nm programname.core
+file consists of the data pages followed by
+the stack pages of the process image.
+The amount of data space image in the
+.Nm programname.core
+file is given (in pages) by the
+variable
+.Fa u_dsize
+in the
+.Fa u .
+area.
+The amount of stack image in the core file is given (in pages) by the
+variable
+.Fa u_ssize
+in the
+.Ar u .
+area.
+The size of a ``page'' is given by the constant
+.Dv NBPG
+(also from
+.Aq Pa sys/param.h ) .
+.Sh SEE ALSO
+.Xr adb 1 ,
+.Xr dbx 1 ,
+.Xr gdb 1 ,
+.Xr kgdb 1 ,
+.Xr sigaction 2 ,
+.Xr setrlimit 2
+.Sh HISTORY
+A
+.Nm core
+file format appeared in
+.At v6 .
diff --git a/share/man/man5/dir.5 b/share/man/man5/dir.5
new file mode 100644
index 00000000000..d852d0c86d6
--- /dev/null
+++ b/share/man/man5/dir.5
@@ -0,0 +1,153 @@
+.\" $NetBSD: dir.5,v 1.5 1995/03/28 17:30:20 jtc Exp $
+.\"
+.\" Copyright (c) 1983, 1991, 1993
+.\" The Regents of the University of California. All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\" must display the following acknowledgement:
+.\" This product includes software developed by the University of
+.\" California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" @(#)dir.5 8.3 (Berkeley) 4/19/94
+.\"
+.Dd April 19, 1994
+.Dt DIR 5
+.Os BSD 4.2
+.Sh NAME
+.Nm dir ,
+.Nm dirent
+.Nd directory file format
+.Sh SYNOPSIS
+.Fd #include <sys/types.h>
+.Fd #include <sys/dir.h>
+.Sh DESCRIPTION
+Directories provide a convenient hierarchical method of grouping
+files while obscuring the underlying details of the storage medium.
+A directory file is differentiated from a plain file
+by a flag in its
+.Xr inode 5
+entry.
+It consists of records (directory entries) each of which contains
+information about a file and a pointer to the file itself.
+Directory entries may contain other directories
+as well as plain files; such nested directories are refered to as
+subdirectories.
+A hierarchy of directories and files is formed in this manner
+and is called a file system (or referred to as a file system tree).
+.\" An entry in this tree,
+.\" nested or not nested,
+.\" is a pathname.
+.Pp
+Each directory file contains two special directory entries; one is a pointer
+to the directory itself
+called dot
+.Ql \&.
+and the other a pointer to its parent directory called dot-dot
+.Ql \&.. .
+Dot and dot-dot
+are valid pathnames, however,
+the system root directory
+.Ql / ,
+has no parent and dot-dot points to itself like dot.
+.Pp
+File system nodes are ordinary directory files on which has
+been grafted a file system object, such as a physical disk or a
+partitioned area of such a disk.
+(See
+.Xr mount 1
+and
+.Xr mount 8 . )
+.Pp
+The directory entry format is defined in the file
+.Aq dirent.h :
+.Bd -literal
+#ifndef _DIRENT_H_
+#define _DIRENT_H_
+
+/*
+* A directory entry has a struct dirent at the front of it, containing its
+* inode number, the length of the entry, and the length of the name
+* contained in the entry. These are followed by the name padded to a 4
+* byte boundary with null bytes. All names are guaranteed null terminated.
+* The maximum length of a name in a directory is MAXNAMLEN.
+*/
+
+struct dirent {
+ u_long d_fileno; /* file number of entry */
+ u_short d_reclen; /* length of this record */
+ u_short d_namlen; /* length of string in d_name */
+#ifdef _POSIX_SOURCE
+ char d_name[MAXNAMLEN + 1]; /* maximum name length */
+#else
+#define MAXNAMLEN 255
+ char d_name[MAXNAMLEN + 1]; /* maximum name length */
+#endif
+
+};
+
+#ifdef _POSIX_SOURCE
+typedef void * DIR;
+#else
+
+#define d_ino d_fileno /* backward compatibility */
+
+/* definitions for library routines operating on directories. */
+#define DIRBLKSIZ 1024
+
+/* structure describing an open directory. */
+typedef struct _dirdesc {
+ int dd_fd; /* file descriptor associated with directory */
+ long dd_loc; /* offset in current buffer */
+ long dd_size; /* amount of data returned by getdirentries */
+ char *dd_buf; /* data buffer */
+ int dd_len; /* size of data buffer */
+ long dd_seek; /* magic cookie returned by getdirentries */
+} DIR;
+
+#define dirfd(dirp) ((dirp)->dd_fd)
+
+#ifndef NULL
+#define NULL 0
+#endif
+
+#endif /* _POSIX_SOURCE */
+
+#ifndef _KERNEL
+
+#include <sys/cdefs.h>
+
+#endif /* !_KERNEL */
+
+#endif /* !_DIRENT_H_ */
+.Ed
+.Sh SEE ALSO
+.Xr fs 5 ,
+.Xr inode 5
+.Sh HISTORY
+A
+.Nm
+file format appeared in
+.At v7 .
diff --git a/share/man/man5/disktab.5 b/share/man/man5/disktab.5
new file mode 100644
index 00000000000..04eddd2cca7
--- /dev/null
+++ b/share/man/man5/disktab.5
@@ -0,0 +1,144 @@
+.\" $NetBSD: disktab.5,v 1.4 1994/11/30 19:31:15 jtc Exp $
+.\"
+.\" Copyright (c) 1983, 1991, 1993
+.\" The Regents of the University of California. All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\" must display the following acknowledgement:
+.\" This product includes software developed by the University of
+.\" California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" @(#)disktab.5 8.1 (Berkeley) 6/5/93
+.\"
+.Dd June 5, 1993
+.Dt DISKTAB 5
+.Os BSD 4.2
+.Sh NAME
+.Nm disktab
+.Nd disk description file
+.Sh SYNOPSIS
+.Fd #include <disktab.h>
+.Sh DESCRIPTION
+.Nm Disktab
+is a simple database which describes disk geometries and
+disk partition characteristics.
+It is used
+.\"by the formatter(\c
+.\"IR.Xr format 8 )
+.\"to determine how to format the disk, and
+to initialize the disk label on the disk.
+The format is patterned
+after the
+.Xr termcap 5
+terminal data base. Entries in
+.Nm disktab
+consist of a number of `:' separated fields. The
+first entry for each disk gives the names which are
+known for the disk, separated by `|' characters. The
+last name given should be a long name fully identifying
+the disk.
+.Pp
+The following list indicates the normal values
+stored for each disk entry.
+.Bl -column "indent" "boolx"
+.It Sy Name Type Description
+.It "\&ty str Type of disk (e.g. removable, winchester)"
+.It "\&dt str Type of controller (e.g."
+.Tn SMD , ESDI ,
+floppy)
+.It "\&ns num Number of sectors per track"
+.It "\&nt num Number of tracks per cylinder"
+.It "\&nc num Total number of cylinders on the disk"
+.It "\&sc num Number of sectors per cylinder, nc*nt default"
+.It "\&su num Number of sectors per unit, sc*nc default"
+.It "\&se num Sector size in bytes,"
+.Dv DEV_BSIZE
+default
+.It "\&sf bool Controller supports bad144-style bad sector forwarding"
+.It "\&rm num Rotation speed, rpm, 3600 default"
+.It "\&sk num Sector skew per track, default 0"
+.It "\&cs num Sector skew per cylinder, default 0"
+.It "\&hs num Headswitch time, usec, default 0"
+.It "\&ts num One-cylinder seek time, usec, default 0"
+.It "\&il num Sector interleave (n:1), 1 default"
+.It "\&d[0-4] num Drive-type-dependent parameters"
+.It "\&bs num Boot block size, default"
+.Dv BBSIZE
+.It "\&sb num Superblock size, default"
+.Dv SBSIZE
+.It "\&ba num Block size for partition `a' (bytes)"
+.It "\&bd num Block size for partition `d' (bytes)"
+.It "\&be num Block size for partition `e' (bytes)"
+.It "\&bf num Block size for partition `f' (bytes)"
+.It "\&bg num Block size for partition `g' (bytes)"
+.It "\&bh num Block size for partition `h' (bytes)"
+.It "\&fa num Fragment size for partition `a' (bytes)"
+.It "\&fd num Fragment size for partition `d' (bytes)"
+.It "\&fe num Fragment size for partition `e' (bytes)"
+.It "\&ff num Fragment size for partition `f' (bytes)"
+.It "\&fg num Fragment size for partition `g' (bytes)"
+.It "\&fh num Fragment size for partition `h' (bytes)"
+.It "\&oa num Offset of partition `a' in sectors"
+.It "\&ob num Offset of partition `b' in sectors"
+.It "\&oc num Offset of partition `c' in sectors"
+.It "\&od num Offset of partition `d' in sectors"
+.It "\&oe num Offset of partition `e' in sectors"
+.It "\&of num Offset of partition `f' in sectors"
+.It "\&og num Offset of partition `g' in sectors"
+.It "\&oh num Offset of partition `h' in sectors"
+.It "\&pa num Size of partition `a' in sectors"
+.It "\&pb num Size of partition `b' in sectors"
+.It "\&pc num Size of partition `c' in sectors"
+.It "\&pd num Size of partition `d' in sectors"
+.It "\&pe num Size of partition `e' in sectors"
+.It "\&pf num Size of partition `f' in sectors"
+.It "\&pg num Size of partition `g' in sectors"
+.It "\&ph num Size of partition `h' in sectors"
+.It "\&ta str Partition type of partition `a'"
+.Pf ( Bx 4.2
+filesystem, swap, etc)
+.It "\&tb str Partition type of partition `b'"
+.It "\&tc str Partition type of partition `c'"
+.It "\&td str Partition type of partition `d'"
+.It "\&te str Partition type of partition `e'"
+.It "\&tf str Partition type of partition `f'"
+.It "\&tg str Partition type of partition `g'"
+.It "\&th str Partition type of partition `h'"
+.El
+.Sh FILES
+.Bl -tag -width /etc/disktab -compact
+.It Pa /etc/disktab
+.El
+.Sh SEE ALSO
+.Xr getdiskbyname 3 ,
+.Xr disklabel 5 ,
+.Xr disklabel 8 ,
+.Xr newfs 8
+.Sh HISTORY
+The
+.Nm
+description file appeared in
+.Bx 4.2 .
diff --git a/share/man/man5/ethers.5 b/share/man/man5/ethers.5
new file mode 100644
index 00000000000..26a681ed19f
--- /dev/null
+++ b/share/man/man5/ethers.5
@@ -0,0 +1,40 @@
+.\" $NetBSD: ethers.5,v 1.2 1994/11/30 19:31:16 jtc Exp $
+.\"
+.\" Written by Roland McGrath <roland@frob.com>. Public domain.
+.\"
+.Dd December 16, 1993
+.Dt ETHERS 5
+.Os NetBSD
+.Sh NAME
+.Nm ethers
+.Nd Ethernet host name data base
+.Sh DESCRIPTION
+The
+.Xr ethers
+file maps Ethernet addresses to host names.
+Lines consist of an address and a host name, separated by any number of blanks and/or tab characters.
+A ``#'' indicates the beginning of a comment; characters up to the end of
+the line are not interpreted by routines which search the file.
+.Pp
+Ethernet addresses are expressed as six hexadecimal numbers separated by colons. The functions described in
+.Xr ethers 3
+and
+.Xr ether_aton 3
+can read and produce this format.
+.Sh FILES
+.Bl -tag -width /etc/ethers -compact
+.It Pa /etc/ethers
+The
+.Nm ethers
+file resides in
+.Pa /etc .
+.El
+.Sh SEE ALSO
+.Xr ethers 3
+.Sh BUGS
+A name server should be used instead of a static file.
+.Sh HISTORY
+The
+.Nm ethers
+file format was adopted from SunOS and appeared in
+NetBSD 0.9b.
diff --git a/share/man/man5/fs.5 b/share/man/man5/fs.5
new file mode 100644
index 00000000000..5d7c2b04d82
--- /dev/null
+++ b/share/man/man5/fs.5
@@ -0,0 +1,344 @@
+.\" $NetBSD: fs.5,v 1.3 1994/11/30 19:31:17 jtc Exp $
+.\"
+.\" Copyright (c) 1983, 1991, 1993
+.\" The Regents of the University of California. All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\" must display the following acknowledgement:
+.\" This product includes software developed by the University of
+.\" California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" @(#)fs.5 8.2 (Berkeley) 4/19/94
+.\"
+.Dd April 19, 1994
+.Dt FS 5
+.Os BSD 4.2
+.Sh NAME
+.Nm fs ,
+.Nm inode
+.Nd format of file system volume
+.Sh SYNOPSIS
+.Fd #include <sys/types.h>
+.Fd #include <ufs/fs.h>
+.Fd #include <ufs/inode.h>
+.Sh DESCRIPTION
+The files
+.Aq Pa fs.h
+and
+.Aq Pa inode.h
+declare several structures, defined variables and macros
+which are used to create and manage the underlying format of
+file system objects on random access devices (disks).
+.Pp
+The block size and number of blocks which
+comprise a file system are parameters of the file system.
+Sectors beginning at
+.Dv BBLOCK
+and continuing for
+.Dv BBSIZE
+are used
+for a disklabel and for some hardware primary
+and secondary bootstrapping programs.
+.Pp
+The actual file system begins at sector
+.Dv SBLOCK
+with the
+.Em super-block
+that is of size
+.Dv SBSIZE .
+The following structure described the super-block and is
+from the file
+.Aq Pa ufs/fs.h :
+.Bd -literal
+#define FS_MAGIC 0x011954
+struct fs {
+ struct fs *fs_link; /* linked list of file systems */
+ struct fs *fs_rlink; /* used for incore super blocks */
+ daddr_t fs_sblkno; /* addr of super-block in filesys */
+ daddr_t fs_cblkno; /* offset of cyl-block in filesys */
+ daddr_t fs_iblkno; /* offset of inode-blocks in filesys */
+ daddr_t fs_dblkno; /* offset of first data after cg */
+ long fs_cgoffset; /* cylinder group offset in cylinder */
+ long fs_cgmask; /* used to calc mod fs_ntrak */
+ time_t fs_time; /* last time written */
+ long fs_size; /* number of blocks in fs */
+ long fs_dsize; /* number of data blocks in fs */
+ long fs_ncg; /* number of cylinder groups */
+ long fs_bsize; /* size of basic blocks in fs */
+ long fs_fsize; /* size of frag blocks in fs */
+ long fs_frag; /* number of frags in a block in fs */
+/* these are configuration parameters */
+ long fs_minfree; /* minimum percentage of free blocks */
+ long fs_rotdelay; /* num of ms for optimal next block */
+ long fs_rps; /* disk revolutions per second */
+/* these fields can be computed from the others */
+ long fs_bmask; /* ``blkoff'' calc of blk offsets */
+ long fs_fmask; /* ``fragoff'' calc of frag offsets */
+ long fs_bshift; /* ``lblkno'' calc of logical blkno */
+ long fs_fshift; /* ``numfrags'' calc number of frags */
+/* these are configuration parameters */
+ long fs_maxcontig; /* max number of contiguous blks */
+ long fs_maxbpg; /* max number of blks per cyl group */
+/* these fields can be computed from the others */
+ long fs_fragshift; /* block to frag shift */
+ long fs_fsbtodb; /* fsbtodb and dbtofsb shift constant */
+ long fs_sbsize; /* actual size of super block */
+ long fs_csmask; /* csum block offset */
+ long fs_csshift; /* csum block number */
+ long fs_nindir; /* value of NINDIR */
+ long fs_inopb; /* value of INOPB */
+ long fs_nspf; /* value of NSPF */
+/* yet another configuration parameter */
+ long fs_optim; /* optimization preference, see below */
+/* these fields are derived from the hardware */
+ long fs_npsect; /* # sectors/track including spares */
+ long fs_interleave; /* hardware sector interleave */
+ long fs_trackskew; /* sector 0 skew, per track */
+ long fs_headswitch; /* head switch time, usec */
+ long fs_trkseek; /* track-to-track seek, usec */
+/* sizes determined by number of cylinder groups and their sizes */
+ daddr_t fs_csaddr; /* blk addr of cyl grp summary area */
+ long fs_cssize; /* size of cyl grp summary area */
+ long fs_cgsize; /* cylinder group size */
+/* these fields are derived from the hardware */
+ long fs_ntrak; /* tracks per cylinder */
+ long fs_nsect; /* sectors per track */
+ long fs_spc; /* sectors per cylinder */
+/* this comes from the disk driver partitioning */
+ long fs_ncyl; /* cylinders in file system */
+/* these fields can be computed from the others */
+ long fs_cpg; /* cylinders per group */
+ long fs_ipg; /* inodes per group */
+ long fs_fpg; /* blocks per group * fs_frag */
+/* this data must be re-computed after crashes */
+ struct csum fs_cstotal; /* cylinder summary information */
+/* these fields are cleared at mount time */
+ char fs_fmod; /* super block modified flag */
+ char fs_clean; /* file system is clean flag */
+ char fs_ronly; /* mounted read-only flag */
+ char fs_flags; /* currently unused flag */
+ char fs_fsmnt[MAXMNTLEN]; /* name mounted on */
+/* these fields retain the current block allocation info */
+ long fs_cgrotor; /* last cg searched */
+ struct csum *fs_csp[MAXCSBUFS]; /* list of fs_cs info buffers */
+ long fs_cpc; /* cyl per cycle in postbl */
+ short fs_opostbl[16][8]; /* old rotation block list head */
+ long fs_sparecon[56]; /* reserved for future constants */
+ quad fs_qbmask; /* ~fs_bmask - for use with quad size */
+ quad fs_qfmask; /* ~fs_fmask - for use with quad size */
+ long fs_postblformat; /* format of positional layout tables */
+ long fs_nrpos; /* number of rotational positions */
+ long fs_postbloff; /* (short) rotation block list head */
+ long fs_rotbloff; /* (u_char) blocks for each rotation */
+ long fs_magic; /* magic number */
+ u_char fs_space[1]; /* list of blocks for each rotation */
+/* actually longer */
+};
+.Ed
+.Pp
+Each disk drive contains some number of file systems.
+A file system consists of a number of cylinder groups.
+Each cylinder group has inodes and data.
+.Pp
+A file system is described by its super-block, which in turn
+describes the cylinder groups. The super-block is critical
+data and is replicated in each cylinder group to protect against
+catastrophic loss. This is done at file system creation
+time and the critical
+super-block data does not change, so the copies need not be
+referenced further unless disaster strikes.
+.Pp
+Addresses stored in inodes are capable of addressing fragments
+of `blocks'. File system blocks of at most size
+.Dv MAXBSIZE
+can
+be optionally broken into 2, 4, or 8 pieces, each of which is
+addressable; these pieces may be
+.Dv DEV_BSIZE ,
+or some multiple of
+a
+.Dv DEV_BSIZE
+unit.
+.Pp
+Large files consist of exclusively large data blocks. To avoid
+undue wasted disk space, the last data block of a small file is
+allocated as only as many fragments of a large block as are
+necessary. The file system format retains only a single pointer
+to such a fragment, which is a piece of a single large block that
+has been divided. The size of such a fragment is determinable from
+information in the inode, using the
+.Fn blksize fs ip lbn
+macro.
+.Pp
+The file system records space availability at the fragment level;
+to determine block availability, aligned fragments are examined.
+.Pp
+The root inode is the root of the file system.
+Inode 0 can't be used for normal purposes and
+historically bad blocks were linked to inode 1,
+thus the root inode is 2 (inode 1 is no longer used for
+this purpose, however numerous dump tapes make this
+assumption, so we are stuck with it).
+.Pp
+The
+.Fa fs_minfree
+element gives the minimum acceptable percentage of file system
+blocks that may be free. If the freelist drops below this level
+only the super-user may continue to allocate blocks.
+The
+.Fa fs_minfree
+element
+may be set to 0 if no reserve of free blocks is deemed necessary,
+however severe performance degradations will be observed if the
+file system is run at greater than 90% full; thus the default
+value of
+.Fa fs_minfree
+is 10%.
+.Pp
+Empirically the best trade-off between block fragmentation and
+overall disk utilization at a loading of 90% comes with a
+fragmentation of 8, thus the default fragment size is an eighth
+of the block size.
+.Pp
+The element
+.Fa fs_optim
+specifies whether the file system should try to minimize the time spent
+allocating blocks, or if it should attempt to minimize the space
+fragmentation on the disk.
+If the value of fs_minfree (see above) is less than 10%,
+then the file system defaults to optimizing for space to avoid
+running out of full sized blocks.
+If the value of minfree is greater than or equal to 10%,
+fragmentation is unlikely to be problematical, and
+the file system defaults to optimizing for time.
+.Pp
+.Em Cylinder group related limits :
+Each cylinder keeps track of the availability of blocks at different
+rotational positions, so that sequential blocks can be laid out
+with minimum rotational latency. With the default of 8 distinguished
+rotational positions, the resolution of the
+summary information is 2ms for a typical 3600 rpm drive.
+.Pp
+The element
+.Fa fs_rotdelay
+gives the minimum number of milliseconds to initiate
+another disk transfer on the same cylinder.
+It is used in determining the rotationally optimal
+layout for disk blocks within a file;
+the default value for
+.Fa fs_rotdelay
+is 2ms.
+.Pp
+Each file system has a statically allocated number of inodes.
+An inode is allocated for each
+.Dv NBPI
+bytes of disk space.
+The inode allocation strategy is extremely conservative.
+.Pp
+.Dv MINBSIZE
+is the smallest allowable block size.
+With a
+.Dv MINBSIZE
+of 4096
+it is possible to create files of size
+2^32 with only two levels of indirection.
+.Dv MINBSIZE
+must be big enough to hold a cylinder group block,
+thus changes to
+.Pq Fa struct cg
+must keep its size within
+.Dv MINBSIZE .
+Note that super-blocks are never more than size
+.Dv SBSIZE .
+.Pp
+The path name on which the file system is mounted is maintained in
+.Fa fs_fsmnt .
+.Dv MAXMNTLEN
+defines the amount of space allocated in
+the super-block for this name.
+The limit on the amount of summary information per file system
+is defined by
+.Dv MAXCSBUFS.
+For a 4096 byte block size, it is currently parameterized for a
+maximum of two million cylinders.
+.Pp
+Per cylinder group information is summarized in blocks allocated
+from the first cylinder group's data blocks.
+These blocks are read in from
+.Fa fs_csaddr
+(size
+.Fa fs_cssize )
+in addition to the super-block.
+.Pp
+.Sy N.B.:
+.Xr sizeof Pq Fa struct csum
+must be a power of two in order for
+the
+.Fn fs_cs
+macro to work.
+.Pp
+The
+.Em "Super-block for a file system" :
+The size of the rotational layout tables
+is limited by the fact that the super-block is of size
+.Dv SBSIZE .
+The size of these tables is
+.Em inversely
+proportional to the block
+size of the file system. The size of the tables is
+increased when sector sizes are not powers of two,
+as this increases the number of cylinders
+included before the rotational pattern repeats
+.Pq Fa fs_cpc .
+The size of the rotational layout
+tables is derived from the number of bytes remaining in
+.Pq Fa struct fs .
+.Pp
+The number of blocks of data per cylinder group
+is limited because cylinder groups are at most one block.
+The inode and free block tables
+must fit into a single block after deducting space for
+the cylinder group structure
+.Pq Fa struct cg .
+.Pp
+The
+.Em Inode :
+The inode is the focus of all file activity in the
+.Tn UNIX
+file system.
+There is a unique inode allocated
+for each active file,
+each current directory, each mounted-on file,
+text file, and the root.
+An inode is `named' by its device/i-number pair.
+For further information, see the include file
+.Aq Pa sys/inode.h .
+.Sh HISTORY
+A super-block structure named filsys appeared in
+.At v6 .
+The file system described in this manual appeared
+in
+.Bx 4.2 .
diff --git a/share/man/man5/fstab.5 b/share/man/man5/fstab.5
new file mode 100644
index 00000000000..371f4f88798
--- /dev/null
+++ b/share/man/man5/fstab.5
@@ -0,0 +1,238 @@
+.\" $NetBSD: fstab.5,v 1.5 1995/02/03 18:17:32 jtc Exp $
+.\"
+.\" Copyright (c) 1980, 1989, 1991, 1993
+.\" The Regents of the University of California. All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\" must display the following acknowledgement:
+.\" This product includes software developed by the University of
+.\" California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" @(#)fstab.5 8.1 (Berkeley) 6/5/93
+.\"
+.Dd June 5, 1993
+.Dt FSTAB 5
+.Os BSD 4
+.Sh NAME
+.Nm fstab
+.Nd static information about the filesystems
+.Sh SYNOPSIS
+.Fd #include <fstab.h>
+.Sh DESCRIPTION
+The file
+.Nm fstab
+contains descriptive information about the various file
+systems.
+.Nm fstab
+is only read by programs, and not written;
+it is the duty of the system administrator to properly create
+and maintain this file.
+Each filesystem is described on a separate line;
+fields on each line are separated by tabs or spaces.
+The order of records in
+.Nm fstab
+is important because
+.Xr fsck 8 ,
+.Xr mount 8 ,
+and
+.Xr umount 8
+sequentially iterate through
+.Nm fstab
+doing their thing.
+.Pp
+The first field,
+.Pq Fa fs_spec ,
+describes the block special device or
+remote filesystem to be mounted.
+For filesystems of type
+.Em ufs ,
+the special file name is the block special file name,
+and not the character special file name.
+If a program needs the character special file name,
+the program must create it by appending a ``r'' after the
+last ``/'' in the special file name.
+.Pp
+The second field,
+.Pq Fa fs_file ,
+describes the mount point for the filesystem.
+For swap partitions, this field should be specified as ``none''.
+.Pp
+The third field,
+.Pq Fa fs_vfstype ,
+describes the type of the filesystem.
+The system currently supports nine types of filesystems:
+.Bl -tag -width indent -offset indent
+.It Em fdesc
+an implementation of /dev/fd
+.It Em cd9660
+an ISO 9660 CD-ROM filesystem
+.It Em kernfs
+various and sundry kernel statistics
+.It Em mfs
+a local memory-based
+.Tn UNIX
+filesystem
+.It Em msdos
+a MSDOS ``FAT'' filesystem
+.It Em nfs
+a Sun Microsystems compatible ``Network File System''
+.It Em procfs
+a local filesystem of process information
+.It Em swap
+a disk partition to be used for swapping
+.It Em ufs
+a local
+.Tn UNIX
+filesystem
+.El
+.Pp
+The fourth field,
+.Pq Fa fs_mntops ,
+describes the mount options associated with the filesystem.
+It is formatted as a comma separated list of options.
+It contains at least the type of mount (see
+.Fa fs_type
+below) plus any additional options
+appropriate to the filesystem type.
+.Pp
+If the options ``userquota'' and/or ``groupquota'' are specified,
+the filesystem is automatically processed by the
+.Xr quotacheck 8
+command, and user and/or group disk quotas are enabled with
+.Xr quotaon 8 .
+By default,
+filesystem quotas are maintained in files named
+.Pa quota.user
+and
+.Pa quota.group
+which are located at the root of the associated filesystem.
+These defaults may be overridden by putting an equal sign
+and an alternative absolute pathname following the quota option.
+Thus, if the user quota file for
+.Pa /tmp
+is stored in
+.Pa /var/quotas/tmp.user ,
+this location can be specified as:
+.Bd -literal -offset indent
+userquota=/var/quotas/tmp.user
+.Ed
+.Pp
+The type of the mount is extracted from the
+.Fa fs_mntops
+field and stored separately in the
+.Fa fs_type
+field (it is not deleted from the
+.Fa fs_mntops
+field).
+If
+.Fa fs_type
+is ``rw'' or ``ro'' then the filesystem whose name is given in the
+.Fa fs_file
+field is normally mounted read-write or read-only on the
+specified special file.
+If
+.Fa fs_type
+is ``sw'' then the special file is made available as a piece of swap
+space by the
+.Xr swapon 8
+command at the end of the system reboot procedure.
+The fields other than
+.Fa fs_spec
+and
+.Fa fs_type
+are unused.
+If
+.Fa fs_type
+is specified as ``xx'' the entry is ignored.
+This is useful to show disk partitions which are currently unused.
+.Pp
+The fifth field,
+.Pq Fa fs_freq ,
+is used for these filesystems by the
+.Xr dump 8
+command to determine which filesystems need to be dumped.
+If the fifth field is not present, a value of zero is returned and
+.Xr dump
+will assume that the filesystem does not need to be dumped.
+.Pp
+The sixth field,
+.Pq Fa fs_passno ,
+is used by the
+.Xr fsck 8
+program to determine the order in which filesystem checks are done
+at reboot time.
+The root filesystem should be specified with a
+.Fa fs_passno
+of 1, and other filesystems should have a
+.Fa fs_passno
+of 2.
+Filesystems within a drive will be checked sequentially,
+but filesystems on different drives will be checked at the
+same time to utilize parallelism available in the hardware.
+If the sixth field is not present or zero,
+a value of zero is returned and
+.Xr fsck
+will assume that the filesystem does not need to be checked.
+.Bd -literal
+#define FSTAB_RW "rw" /* read-write device */
+#define FSTAB_RO "ro" /* read-only device */
+#define FSTAB_SW "sw" /* swap device */
+#define FSTAB_XX "xx" /* ignore totally */
+
+struct fstab {
+ char *fs_spec; /* block special device name */
+ char *fs_file; /* filesystem path prefix */
+ char *fs_vfstype; /* type of filesystem */
+ char *fs_mntops; /* comma separated mount options */
+ char *fs_type; /* rw, ro, sw, or xx */
+ int fs_freq; /* dump frequency, in days */
+ int fs_passno; /* pass number on parallel dump */
+};
+.Ed
+.Pp
+The proper way to read records from
+.Pa fstab
+is to use the routines
+.Xr getfsent 3 ,
+.Xr getfsspec 3 ,
+.Xr getfstype 3 ,
+and
+.Xr getfsfile 3 .
+.Sh FILES
+.Bl -tag -width /etc/fstab -compact
+.It Pa /etc/fstab
+The file
+.Nm fstab
+resides in
+.Pa /etc .
+.El
+.Sh SEE ALSO
+.Xr getfsent 3
+.Sh HISTORY
+The
+.Nm
+file format appeared in
+.Bx 4.0 .
diff --git a/share/man/man5/group.5 b/share/man/man5/group.5
new file mode 100644
index 00000000000..115c6f7c817
--- /dev/null
+++ b/share/man/man5/group.5
@@ -0,0 +1,149 @@
+.\" $NetBSD: group.5,v 1.4 1995/07/28 06:41:39 phil Exp $
+.\"
+.\" Copyright (c) 1980, 1991, 1993
+.\" The Regents of the University of California. All rights reserved.
+.\" Portions Copyright(c) 1994, Jason Downs. All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\" must display the following acknowledgement:
+.\" This product includes software developed by the University of
+.\" California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" @(#)group.5 8.3 (Berkeley) 4/19/94
+.\"
+.Dd July 18, 1995
+.Dt GROUP 5
+.Os
+.Sh NAME
+.Nm group
+.Nd format of the group permissions file
+.Sh DESCRIPTION
+The file
+.Aq Pa /etc/group
+consists of newline separated
+.Tn ASCII
+records, one per group, containing four colon
+.Ql \&:
+separated fields. These fields are as follows:
+.Bl -tag -width password -offset indent -compact
+.It group
+Name of the group.
+.It passwd
+Group's
+.Em encrypted
+password.
+.It gid
+The group's decimal ID.
+.It member
+Group members.
+.El
+.Pp
+The
+.Ar group
+field is the group name used for granting file access to users
+who are members of the group.
+The
+.Ar gid
+field is the number associated with the group name.
+They should both be unique across the system (and often
+across a group of systems) since they control file access.
+The
+.Ar passwd
+field
+is an optional
+.Em encrypted
+password.
+This field is rarely used
+and an asterisk is normally placed in it rather than leaving it blank.
+The
+.Ar member
+field contains the names of users granted the privileges of
+.Ar group .
+The member names are separated by commas without spaces or newlines.
+A user is automatically in a group if that group was specified
+in their
+.Pa /etc/passwd
+entry and does not need to be added to that group in the
+.Pa /etc/group file.
+.\" .Pp
+.\" When the system reads the file
+.\" .Pa /etc/group
+.\" the fields are read into the structure
+.\" .Fa group
+.\" declared in
+.\" .Aq Pa grp.h :
+.\" .Bd -literal -offset indent
+.\" struct group {
+.\" char *gr_name; /* group name */
+.\" char *gr_passwd; /* group password */
+.\" int gr_gid; /* group id */
+.\" char **gr_mem; /* group members */
+.\" };
+.\" .Ed
+.Sh YP SUPPORT
+If YP is active, the
+.Nm
+file may also contain lines of the format
+.Pp
+.Bl -tag -offset indent -compact
++name:*::
+.Pp
+which causes the specified group to be included from the
+.Pa group.byname
+YP map.
+.Pp
+If no group name is specified, or the ``+'' (plus sign) appears alone
+on line, all groups are included from the YP map.
+.Pp
+YP references may appear anywhere in the file, but the single ``+'' form
+should be on the last line, for historical reasons.
+Only the first group with a specific name encountered, whether in the
+.Nm
+file itself, or included via YP, will be used.
+.Sh FILES
+.Bl -tag -width /etc/group -compact
+.It Pa /etc/group
+.El
+.Sh SEE ALSO
+.Xr setgroups 2 ,
+.Xr initgroups 3 ,
+.Xr crypt 3 ,
+.Xr passwd 1 ,
+.Xr passwd 5 ,
+.Xr yp 8
+.Sh BUGS
+The
+.Xr passwd 1
+command does not change the
+.Nm group
+passwords.
+.Sh HISTORY
+A
+.Nm
+file format appeared in
+.At v6 .
+.Pp
+YP file format first appeared in SunOS.
diff --git a/share/man/man5/hosts.5 b/share/man/man5/hosts.5
new file mode 100644
index 00000000000..f38295bad34
--- /dev/null
+++ b/share/man/man5/hosts.5
@@ -0,0 +1,111 @@
+.\" $NetBSD: hosts.5,v 1.4 1994/11/30 19:31:20 jtc Exp $
+.\"
+.\" Copyright (c) 1983, 1991, 1993
+.\" The Regents of the University of California. All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\" must display the following acknowledgement:
+.\" This product includes software developed by the University of
+.\" California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" @(#)hosts.5 8.2 (Berkeley) 12/11/93
+.\"
+.Dd December 11, 1993
+.Dt HOSTS 5
+.Os BSD 4.2
+.Sh NAME
+.Nm hosts
+.Nd host name data base
+.Sh DESCRIPTION
+The
+.Nm hosts
+file contains information regarding
+the known hosts on the network.
+For each host a single line should be present
+with the following information:
+.Bd -unfilled -offset indent
+Internet address
+Official host name
+Aliases
+.Ed
+.Pp
+Items are separated by any number of blanks and/or
+tab characters. A ``#'' indicates the beginning of
+a comment; characters up to the end of the line are
+not interpreted by routines which search the file.
+.Pp
+When using the name server
+.Xr named 8 ,
+this file provides a backup when the name server
+is not running.
+For the name server, it is suggested that only a few addresses
+be included in this file.
+These include address for the local interfaces that
+.Xr ifconfig 8
+needs at boot time and a few machines on the local network.
+.Pp
+This file may be created from the official host
+data base maintained at the Network Information Control
+Center
+.Pq Tn NIC ,
+though local changes may be required
+to bring it up to date regarding unofficial aliases
+and/or unknown hosts. As the data base maintained at
+.Tn NIC
+is incomplete, use of the name server is recommended for
+sites on the
+.Tn DARPA
+Internet.
+.Pp
+Network addresses are specified in the conventional
+``.'' (dot) notation using the
+.Xr inet_addr 3
+routine
+from the Internet address manipulation library,
+.Xr inet 3 .
+Host names may contain any printable
+character other than a field delimiter, newline,
+or comment character.
+.Sh FILES
+.Bl -tag -width /etc/hosts -compact
+.It Pa /etc/hosts
+The
+.Nm hosts
+file resides in
+.Pa /etc .
+.El
+.Sh SEE ALSO
+.Xr gethostbyname 3 ,
+.Xr ifconfig 8 ,
+.Xr named 8
+.Rs
+.%T "Name Server Operations Guide for BIND"
+.Re
+.Sh HISTORY
+The
+.Nm
+file format appeared in
+.Bx 4.2 .
diff --git a/share/man/man5/link.5 b/share/man/man5/link.5
new file mode 100644
index 00000000000..addfcaa39a8
--- /dev/null
+++ b/share/man/man5/link.5
@@ -0,0 +1,577 @@
+.\" $NetBSD: link.5,v 1.4 1995/09/30 21:28:19 pk Exp $
+.\"
+.\" Copyright (c) 1993 Paul Kranenburg
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\" must display the following acknowledgement:
+.\" This product includes software developed by Paul Kranenburg.
+.\" 3. The name of the author may not be used to endorse or promote products
+.\" derived from this software without specific prior written permission
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+.\"
+.Dd October 23, 1993
+.Dt LINK 5
+.Os
+.Sh NAME
+.Nm link
+.Nd dynamic loader and link editor interface
+.Sh SYNOPSIS
+.Fd #include <link.h>
+.Sh DESCRIPTION
+The include file
+.Aq Pa link.h
+declares several structures that are present in dynamically linked
+programs and libraries.
+The structures define the interface between several components of the
+link-editor and loader mechanism. The layout of a number of these
+structures within the binaries resembles the a.out format in many places
+as it serves such similar functions as symbol definitions (including the
+accompanying string table) and relocation records needed to resolve
+references to external entities. It also records a number of data structures
+unique to the dynamic loading and linking process. These include references
+to other objects that are required to complete the link-editing process and
+indirection tables to facilitate
+.Em Position Independent Code
+(PIC for short) to improve sharing of code pages among different processes.
+The collection of data structures described here will be refered to as the
+.Em Run-time Relocation Section (RRS)
+and is embedded in the standard text and data segments of the dynamically
+linked program or shared object image as the existing
+.Xr a.out
+format offers no room for it elsewhere.
+.Pp
+Several utilities co-operate to ensure that the task of getting a program
+ready to run can complete successfully in a way that optimizes the use
+of system resources. The compiler emits PIC code from which shared libraries
+can be built by
+.Xr ld 1 .
+The compiler also includes size information of any initialized data items
+through the .size assembler directive. PIC code differs from conventional code
+in that it accesses data variables through an indirection table, the
+Global Offset Table, by convention accessable by the reserved name
+.Em _GLOBAL_OFFSET_TABLE_ .
+The exact mechanism used for this is machine dependent, usually a machine
+register is reserved for the purpose. The rational behind this construct
+is to generate code that is independent of the actual load address. Only
+the values contained in the Global Offset Table may need updating at run-time
+depending on the load addresses of the various shared objects in the address
+space.
+.Pp
+Likewise, procedure calls to globally defined functions are redirected through
+the Procedure Linkage Table (PLT) residing in the data segment of the core
+image. Again, this is done to avoid run-time modifications to the text segment.
+.Pp
+The linker-editor allocates the Global Offset Table and Procedure Linkage Table
+when combining PIC object files into an image suitable for mapping into the
+process address space. It also collects all symbols that may be needed by the
+run-time link-editor and stores these along with the image's text and data bits.
+Another reserved symbol,
+.Em _DYNAMIC
+is used to indicate the presence of the run-time linker structures. Whenever
+_DYNAMIC is relocated to 0, there is no need to invoke the run-time
+link-editor. If this symbol is non-zero, it points at a data structure from
+which the location of the necessary relocation- and symbol information can
+be derived. This is most notably used by the start-up module,
+.Em crt0 .
+The _DYNAMIC structure is conventionally located at the start of the data
+segment of the image to which it pertains.
+.Pp
+.Sh DATA STRUCTURES
+The data structures supporting dynamic linking and run-time relocation
+reside both in the text and data segments of the image they apply to.
+The text segments contain read-only data such as symbols descriptions and
+names, while the data segments contain the tables that need to be modified by
+during the relocation process.
+.Pp
+The _DYNAMIC symbol references a
+.Fa _dynamic
+structure:
+.Bd -literal -offset indent
+struct _dynamic {
+ int d_version;
+ struct so_debug *d_debug;
+ union {
+ struct section_dispatch_table *d_sdt;
+ } d_un;
+ struct ld_entry *d_entry;
+};
+.Ed
+.Bl -tag -width d_version
+.It Fa d_version
+This field provides for different versions of the dynamic linking
+implementation. The current version numbers understood by ld and ld.so are
+.Em LD_VERSION_SUN (3),
+which is used by the SunOS 4.x releases, and
+.Em LD_VERSION_BSD (8),
+which is currently in use by NetBSD.
+.It Fa d_un
+Refers to a
+.Em d_version
+dependent data structure.
+.It Fa d_debug
+this field provides debuggers with a hook to access symbol tables of shared
+objects loaded as a result of the actions of the run-time link-editor.
+.It Fa d_entry
+this field is obsoleted by CRT interface version CRT_VERSION_BSD4, and is
+replaced by the crt_ldentry in
+.Fa crt_ldso .
+.El
+.Pp
+The
+.Fa section_dispatch_table
+structure is the main
+.Dq dispatcher
+table, containing offsets into the image's segments where various symbol
+and relocation information is located.
+.Bd -literal -offset indent
+struct section_dispatch_table {
+ struct so_map *sdt_loaded;
+ long sdt_sods;
+ long sdt_paths;
+ long sdt_got;
+ long sdt_plt;
+ long sdt_rel;
+ long sdt_hash;
+ long sdt_nzlist;
+ long sdt_filler2;
+ long sdt_buckets;
+ long sdt_strings;
+ long sdt_str_sz;
+ long sdt_text_sz;
+ long sdt_plt_sz;
+};
+.Ed
+.Pp
+.Bl -tag -width sdt_loaded
+.It Fa sdt_loaded
+A pointer to the first link map loaded (see below). This field is set by
+.Xr ld.so
+for the benefit of debuggers that may use it to load a shared object's
+symbol table.
+.It Fa sdt_sods
+The start of a (linked) list of shared object descriptors needed by
+.Em this
+object.
+.It Fa sdt_paths
+Library search rules. A colon separated list of directories corresponding
+to the
+.Fl R
+option of
+.Xr ld 1 .
+.It Fa sdt_got
+The location of the Global Offset Table within this image.
+.It Fa sdt_plt
+The location of the Procedure Linkage Table within this image.
+.It Fa sdt_rel
+The location of an array of
+.Fa relocation_info
+structures
+.Po
+see
+.Xr a.out 5
+.Pc
+specifying run-time relocations.
+.It Fa sdt_hash
+The location of the hash table for fast symbol lookup in this object's
+symbol table.
+.It Fa sdt_nzlist
+The location of the symbol table.
+.It Fa sdt_filler2
+Currently unused.
+.It Fa sdt_buckets
+The number of buckets in
+.Fa sdt_hash
+.It Fa sdt_strings
+The location of the symbol string table that goes with
+.Fa sdt_nzlist .
+.It Fa sdt_str_sz
+The size of the string table.
+.It Fa sdt_text_sz
+The size of the object's text segment.
+.It Fa sdt_plt_sz
+The size of the Procedure Linkage Table.
+.El
+.Pp
+A
+.Fa sod
+structure descibes a shared object that is needed
+to complete the link edit process of the object containing it.
+A list of such objects
+.Po
+chained through
+.Fa sod_next
+.Pc
+is pointed at
+by the
+.Fa sdt_sods
+in the section_dispatch_table structure.
+.Bd -literal -offset indent
+struct sod {
+ long sod_name;
+ u_int sod_library : 1,
+ sod_unused : 31;
+ short sod_major;
+ short sod_minor;
+ long sod_next;
+};
+.Ed
+.Pp
+.Bl -tag -width sod_library
+.It Fa sod_name
+The offset in the text segment of a string describing this link object.
+.It Fa sod_library
+If set,
+.Fa sod_name
+specifies a library that is to be searched for by ld.so. The path name
+is obtained by searching a set of directories
+.Po
+see also
+.Xr ldconfig 8
+.Pc
+for a shared object matching
+.Em lib\&<sod_name>\&.so.n.m .
+If not set,
+.Fa sod_name
+should point at a full path name for the desired shared object.
+.It Fa sod_major
+Specifies the major version number of the shared object to load.
+.It Fa sod_minor
+Specifies the prefered minor version number of the shared object to load.
+.El
+.Pp
+The run-time link-editor maintains a list of structures called
+.Em link maps
+to keep track of all shared objects loaded into a process' address space.
+These structures are only used at run-time and do not occur within
+the text or data segment of an executable or shared library.
+.Bd -literal -offset indent
+struct so_map {
+ caddr_t som_addr;
+ char *som_path;
+ struct so_map *som_next;
+ struct sod *som_sod;
+ caddr_t som_sodbase;
+ u_int som_write : 1;
+ struct _dynamic *som_dynamic;
+ caddr_t som_spd;
+};
+.Ed
+.Bl -tag -width som_dynamic
+.It Fa som_addr
+The address at which the shared object associated with this link map has
+been loaded.
+.It Fa som_path
+The full path name of the loaded object.
+.It Fa som_next
+Pointer to the next link map.
+.It Fa som_sod
+The
+.Fa sod
+structure that was responsible for loading this shared object.
+.It Fa som_sodbase
+Tossed in later versions the run-time linker.
+.It Fa som_write
+Set if (some portion of) this object's text segment is currently writable.
+.It Fa som_dynamic
+Pointer to this object's
+.Fa _dynamic
+structure.
+.It Fa som_spd
+Hook for attaching private data maintained by the run-time link-editor.
+.El
+.Pp
+Symbol description with size. This is simply an
+.Fa nlist
+structure with one field
+.Pq Fa nz_size
+added. Used to convey size information on items in the data segment
+of shared objects. An array of these lives in the shared object's
+text segment and is addressed by the
+.Fa sdt_nzlist
+field of
+.Fa section_dispatch_table .
+.Bd -literal -offset indent
+struct nzlist {
+ struct nlist nlist;
+ u_long nz_size;
+#define nz_un nlist.n_un
+#define nz_strx nlist.n_un.n_strx
+#define nz_name nlist.n_un.n_name
+#define nz_type nlist.n_type
+#define nz_value nlist.n_value
+#define nz_desc nlist.n_desc
+#define nz_other nlist.n_other
+};
+.Ed
+.Bl -tag -width nz_size
+.It Fa nlist
+.Po
+see
+.Xr nlist 5
+.Pc .
+.It Fa nz_size
+The size of the data represented by this symbol.
+.El
+.Pp
+A hash table is included within the text segment of shared object to
+to facilitate quick lookup of symbols during run-time link-editing.
+The
+.Fa sdt_hash
+field of the
+.Fa section_dispatch_table
+structure points at an array of
+.Fa rrs_hash
+structures:
+.Bd -literal -offset indent
+struct rrs_hash {
+ int rh_symbolnum; /* symbol number */
+ int rh_next; /* next hash entry */
+};
+.Ed
+.Pp
+.Bl -tag -width rh_symbolnum
+.It Fa rh_symbolnum
+The index of the symbol in the shared object's symbol table (as given by the
+.Fa ld_symbols
+field).
+.It Fa rh_next
+In case of collisions, this field is the offset of the next entry in this
+hash table bucket. It is zero for the last bucket element.
+.El
+The
+.Fa rt_symbol
+structure is used to keep track of run-time allocated commons
+and data items copied from shared objects. These items are kept on linked list
+and is exported through the
+.Fa dd_cc
+field in the
+.Fa so_debug
+structure (see below) for use by debuggers.
+.Bd -literal -offset indent
+struct rt_symbol {
+ struct nzlist *rt_sp;
+ struct rt_symbol *rt_next;
+ struct rt_symbol *rt_link;
+ caddr_t rt_srcaddr;
+ struct so_map *rt_smp;
+};
+.Ed
+.Pp
+.Bl -tag -width rt_scraddr
+.It Fa rt_sp
+The symbol description.
+.It Fa rt_next
+Virtual address of next rt_symbol.
+.It Fa rt_link
+Next in hash bucket. Used by internally by ld.so.
+.It Fa rt_srcaddr
+Location of the source of initialized data within a shared object.
+.It Fa rt_smp
+The shared object which is the original source of the data that this
+run-time symbol describes.
+.El
+.Pp
+The
+.Fa so_debug
+structure is used by debuggers to gain knowledge of any shared objects
+that have been loaded in the process's address space as a result of run-time
+link-editing. Since the run-time link-editor runs as a part of process
+initialization, a debugger that wishes to access symbols from shared objects
+can only do so after the link-editor has been called from crt0.
+A dynamically linked binary contains a
+.Fa so_debug
+structure which can be located by means of the
+.Fa d_debug
+field in
+.Fa _dynamic .
+.Bd -literal -offset indent
+struct so_debug {
+ int dd_version;
+ int dd_in_debugger;
+ int dd_sym_loaded;
+ char *dd_bpt_addr;
+ int dd_bpt_shadow;
+ struct rt_symbol *dd_cc;
+};
+.Ed
+.Pp
+.Bl -tag -width dd_in_debugger
+.It Fa dd_version
+Version number of this interface.
+.It Fa dd_in_debugger
+Set by the debugger to indicate to the run-time linker that the program is
+run under control of a debugger.
+.It Fa dd_sym_loaded
+Set by the run-time linker whenever it adds symbols by loading shared objects.
+.It Fa dd_bpt_addr
+The address were a breakpoint will be set by the the run-time linker to
+divert control to the debugger. This address is determined by the start-up
+module,
+.Em crt0.o,
+to be some convenient place before the call to _main.
+.It Fa dd_bpt_shadow
+Contains the original instruction that was at
+.Fa dd_bpt_addr .
+The debugger is expected to put this instruction back before continuing the
+program.
+.It Fa dd_cc
+A pointer to the linked list of run-time allocated symbols that the debugger
+may be interested in.
+.El
+.Pp
+The
+.Em ld_entry
+structure defines a set of service routines within ld.so. See
+.Xr dlfcn 3
+for more information.
+.Bd -literal -offset indent
+struct ld_entry {
+ void *(*dlopen)(char *, int);
+ int (*dlclose)(void *);
+ void *(*dlsym)(void *, char *);
+ int (*dlctl)(void *, int, void *);
+ void (*dlexit) __P((void));
+};
+.Ed
+
+The
+.Fa crt_ldso
+structure defines the interface between ld.so and the start-up code in crt0.
+.Bd -literal -offset indent
+struct crt_ldso {
+ int crt_ba;
+ int crt_dzfd;
+ int crt_ldfd;
+ struct _dynamic *crt_dp;
+ char **crt_ep;
+ caddr_t crt_bp;
+ char *crt_prog;
+ char *crt_ldso;
+ char *crt_ldentry;
+};
+#define CRT_VERSION_SUN 1
+#define CRT_VERSION_BSD2 2
+#define CRT_VERSION_BSD3 3
+#define CRT_VERSION_BSD4 4
+.Ed
+.Bl -tag -width crt_dzfd
+.It Fa crt_ba
+The virtual address at which ld.so was loaded by crt0.
+.It Fa crt_dzfd
+On SunOS systems, this field contains an open file descriptor to
+.Dq /dev/zero
+used to get demand paged zeroed pages. On NetBSD systems it contains -1.
+.It Fa crt_ldfd
+Contains an open file descriptor that was used by crt0 to load ld.so.
+.It Fa crt_dp
+A pointer to main's
+.Fa _dynamic
+structure.
+.It Fa crt_ep
+A pointer to the environment strings.
+.It Fa crt_bp
+The address at which a breakpoint will be placed by the run-time linker
+if the main program is run by a debugger.
+See
+.Fa so_debug
+.It Fa crt_prog
+The name of the main program as determined by crt0 (CRT_VERSION_BSD3 only).
+.It Fa crt_ldso
+The path of the run-time linker as mapped by crt0 (CRT_VERSION_BSD4 only).
+.It Fa crt_ldentry
+The
+.Xr dlfcn 3
+entry points provided by the run-time linker (CRT_VERSION_BSD4 only).
+.El
+.Pp
+The
+.Fa hints_header
+and
+.Fa hints_bucket
+structures define the layout of the library hints, normally found in
+.Dq /var/run/ld.so.hints,
+which is used by ld.so to quickly locate the shared object images in the
+filesystem.
+The organization of the hints file is not unlike that of an
+.Dq a.out
+object file, in that it contains a header determining the offset and size
+of a table of fixed sized hash buckets and a common string pool.
+.Bd -literal -offset indent
+struct hints_header {
+ long hh_magic;
+#define HH_MAGIC 011421044151
+ long hh_version;
+#define LD_HINTS_VERSION_1 1
+ long hh_hashtab;
+ long hh_nbucket;
+ long hh_strtab;
+ long hh_strtab_sz;
+ long hh_ehints;
+};
+.Ed
+.Bl -tag -width hh_strtab_sz
+.It Fa hh_magic
+Hints file magic number.
+.It Fa hh_version
+Interface version number.
+.It Fa hh_hashtab
+Offset of hash table.
+.It Fa hh_strtab
+Offset of string table.
+.It Fa hh_strtab_sz
+Size of strings.
+.It Fa hh_ehints
+Maximum usable offset in hints file.
+.El
+.Pp
+.Bd -literal -offset indent
+/*
+ * Hash table element in hints file.
+ */
+struct hints_bucket {
+ int hi_namex;
+ int hi_pathx;
+ int hi_dewey[MAXDEWEY];
+ int hi_ndewey;
+#define hi_major hi_dewey[0]
+#define hi_minor hi_dewey[1]
+ int hi_next;
+};
+.Ed
+.Bl -tag -width hi_ndewey
+.It Fa hi_namex
+Index of the string identifying the library.
+.It Fa hi_pathx
+Index of the string representing the full path name of the library.
+.It Fa hi_dewey
+The version numbers of the shared library.
+.It Fa hi_ndewey
+The number of valid entries in
+.Fa hi_dewey .
+.It Fa hi_next
+Next bucket in case of hashing collisions.
+.El
+
+.Sh CAVEATS
+Only the (GNU) C compiler currently supports the creation of shared libraries.
+Other programming languages can not be used.
+
diff --git a/share/man/man5/motd.5 b/share/man/man5/motd.5
new file mode 100644
index 00000000000..3e573922e30
--- /dev/null
+++ b/share/man/man5/motd.5
@@ -0,0 +1,38 @@
+.\" $NetBSD: motd.5,v 1.2 1994/12/28 18:58:53 glass Exp $
+.\"
+.\" This file is in the public domain.
+.\"
+.Dd December 28, 1994
+.Dt MOTD 5
+.Os
+.Sh NAME
+.Nm motd
+.Nd file containing message(s) of the day
+.Sh DESCRIPTION
+The file
+.Pa /etc/motd
+is normally displayed by
+.Xr login 1
+after a user has logged in but before the shell is run.
+It is generally used for important system-wide announcements.
+During system startup, a line containing the kernel version string is
+prepended to this file.
+.Pp
+Individual users may suppress the display of this file by
+creating a file named
+.Dq Pa .hushlogin
+in their home directories.
+.Sh FILES
+.Bl -tag -width /etc/motd -compact
+.It Pa /etc/motd
+.El
+.Sh EXAMPLES
+.Bd -literal
+NetBSD 1.0 (SUN_LAMP) #9: Sun Nov 20 22:47:57 PST 1994
+
+Make sure you have a .forward file...
+
+4/17 Machine will be down for backups all day Saturday.
+.Ed
+.Sh SEE ALSO
+.Xr login 1
diff --git a/share/man/man5/netgroup.5 b/share/man/man5/netgroup.5
new file mode 100644
index 00000000000..ea893d68612
--- /dev/null
+++ b/share/man/man5/netgroup.5
@@ -0,0 +1,112 @@
+.\" $NetBSD: netgroup.5,v 1.3 1995/03/18 14:58:34 cgd Exp $
+.\"
+.\" Copyright (c) 1992, 1993
+.\" The Regents of the University of California. All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\" must display the following acknowledgement:
+.\" This product includes software developed by the University of
+.\" California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" @(#)netgroup.5 8.2 (Berkeley) 12/11/93
+.\"
+.Dd December 11, 1993
+.Dt NETGROUP 5
+.Os
+.Sh NAME
+.Nm netgroup
+.Nd defines network groups
+.Sh SYNOPSIS
+.Nm netgroup
+.Sh DESCRIPTION
+The
+.Nm netgroup
+file
+specifies ``netgroups'', which are sets of
+.Sy (host, user, domain)
+tuples that are to be given similar network access.
+.Pp
+Each line in the file
+consists of a netgroup name followed by a list of the members of the
+netgroup.
+Each member can be either the name of another netgroup or a specification
+of a tuple as follows:
+.Bd -literal -offset indent
+(host, user, domain)
+.Ed
+where the
+.Sy host ,
+.Sy user ,
+and
+.Sy domain
+are character string names for the corresponding component.
+Any of the comma separated fields may be empty to specify a ``wildcard'' value
+or may consist of the string ``-'' to specify ``no valid value''.
+The members of the list may be separated by whitespace;
+the ``\e'' character may be used at the end of a line to specify
+line continuation.
+The functions specified in
+.Xr getnetgrent 3
+should normally be used to access the
+.Nm netgroup
+database.
+.Pp
+These functions operate on the
+.Xr db
+version of the
+.Nm netgroup
+.Nm (netgroup.db)
+file which can be generated using
+.Xr netgroup_mkdb .
+If that file is not present, and the system supports
+.Sy NIS,
+then the
+.Nm netgroup
+.Sy NIS
+maps are used. The
+.Sy NIS
+maps are also used if the
+.Nm netgroup
+file contains a
+.Sy +
+entry.
+.Pp
+Lines that begin with a # are treated as comments.
+.Sh FILES
+.Bl -tag -width /etc/netgroup.db -compact
+.It Pa /etc/netgroup.db
+the netgroup database.
+.El
+.Sh SEE ALSO
+.Xr netgroup_mkdb 8 ,
+.Xr getnetgrent 3 ,
+.Xr exports 5
+.Sh COMPATIBILITY
+The file format is compatible with that of various vendors, however it
+appears that not all vendors use an identical format.
+.Sh BUGS
+The interpretation of access restrictions based on the member tuples of a
+netgroup is left up to the various network applications.
diff --git a/share/man/man5/networks.5 b/share/man/man5/networks.5
new file mode 100644
index 00000000000..8e4ad008468
--- /dev/null
+++ b/share/man/man5/networks.5
@@ -0,0 +1,90 @@
+.\" $NetBSD: networks.5,v 1.3 1994/11/30 19:31:23 jtc Exp $
+.\"
+.\" Copyright (c) 1983, 1991, 1993
+.\" The Regents of the University of California. All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\" must display the following acknowledgement:
+.\" This product includes software developed by the University of
+.\" California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" @(#)networks.5 8.1 (Berkeley) 6/5/93
+.\"
+.Dd June 5, 1993
+.Dt NETWORKS 5
+.Os BSD 4.2
+.Sh NAME
+.Nm networks
+.Nd network name data base
+.Sh DESCRIPTION
+The
+.Xr networks
+file contains information regarding
+the known networks which comprise the
+.Tn DARPA
+Internet.
+For each network a single line should be present with the following information:
+.Bd -unfilled -offset indent
+official network name
+network number
+aliases
+.Ed
+.Pp
+Items are separated by any number of blanks and/or tab characters.
+A ``#'' indicates the beginning of a comment; characters up to the end of
+the line are not interpreted by routines which search the file.
+This file is normally created from the official network data base
+maintained at the Network Information Control Center
+.Pq Tn NIC ,
+though local
+changes may be required to bring it up to date regarding unofficial aliases
+and/or unknown networks.
+.Pp
+Network number may be specified in the conventional
+``.'' (dot) notation using the
+.Xr inet_network 3
+routine
+from the Internet address manipulation library,
+.Xr inet 3 .
+Network names may contain any printable character other than a field
+delimiter, newline, or comment character.
+.Sh FILES
+.Bl -tag -width /etc/networks -compact
+.It Pa /etc/networks
+The
+.Nm networks
+file resides in
+.Pa /etc .
+.El
+.Sh SEE ALSO
+.Xr getnetent 3
+.Sh BUGS
+A name server should be used instead of a static file.
+.Sh HISTORY
+The
+.Nm
+file format appeared in
+.Bx 4.2 .
diff --git a/share/man/man5/passwd.5 b/share/man/man5/passwd.5
new file mode 100644
index 00000000000..77dd659ed5c
--- /dev/null
+++ b/share/man/man5/passwd.5
@@ -0,0 +1,239 @@
+.\" $NetBSD: passwd.5,v 1.4 1995/07/28 06:46:05 phil Exp $
+.\"
+.\" Copyright (c) 1988, 1991, 1993
+.\" The Regents of the University of California. All rights reserved.
+.\" Portions Copyright (c) 1994, Jason Downs. All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\" must display the following acknowledgement:
+.\" This product includes software developed by the University of
+.\" California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" @(#)passwd.5 8.1 (Berkeley) 6/5/93
+.\"
+.Dd July 18, 1995
+.Dt PASSWD 5
+.Os
+.Sh NAME
+.Nm passwd
+.Nd format of the password file
+.Sh DESCRIPTION
+The
+.Nm passwd
+files are files consisting of newline separated records, one per user,
+containing ten colon (``:'') separated fields. These fields are as
+follows:
+.Pp
+.Bl -tag -width password -offset indent
+.It name
+User's login name.
+.It password
+User's
+.Em encrypted
+password.
+.It uid
+User's id.
+.It gid
+User's login group id.
+.It class
+User's general classification (unused).
+.It change
+Password change time.
+.It expire
+Account expiration time.
+.It gecos
+General information about the user.
+.It home_dir
+User's home directory.
+.It shell
+User's login shell.
+.El
+.Pp
+The
+.Ar name
+field is the login used to access the computer account, and the
+.Ar uid
+field is the number associated with it. They should both be unique
+across the system (and often across a group of systems) since they
+control file access.
+.Pp
+While it is possible to have multiple entries with identical login names
+and/or identical user id's, it is usually a mistake to do so. Routines
+that manipulate these files will often return only one of the multiple
+entries, and that one by random selection.
+.Pp
+The login name must never begin with a hyphen (``-''); also, it is strongly
+suggested that neither upper-case characters or dots (``.'') be part
+of the name, as this tends to confuse mailers. No field may contain a
+colon (``:'') as this has been used historically to separate the fields
+in the user database.
+.Pp
+The password field is the
+.Em encrypted
+form of the password.
+If the
+.Ar password
+field is empty, no password will be required to gain access to the
+machine. This is almost invariably a mistake.
+Because these files contain the encrypted user passwords, they should
+not be readable by anyone without appropriate privileges.
+.Pp
+The group field is the group that the user will be placed in upon login.
+Since this system supports multiple groups (see
+.Xr groups 1 )
+this field currently has little special meaning.
+.Pp
+The
+.Ar class
+field is currently unused. In the near future it will be a key to
+a
+.Xr termcap 5
+style database of user attributes.
+.Pp
+The
+.Ar change
+field is the number in seconds,
+.Dv GMT ,
+from the epoch, until the
+password for the account must be changed.
+This field may be left empty to turn off the password aging feature.
+.Pp
+The
+.Ar expire
+field is the number in seconds,
+.Dv GMT ,
+from the epoch, until the
+account expires.
+This field may be left empty to turn off the account aging feature.
+.Pp
+The
+.Ar gecos
+field normally contains comma (``,'') separated subfields as follows:
+.Pp
+.Bd -unfilled -offset indent
+name user's full name
+office user's office number
+wphone user's work phone number
+hphone user's home phone number
+.Ed
+.Pp
+This information is used by the
+.Xr finger 1
+program.
+.Pp
+The user's home directory is the full
+.Tn UNIX
+path name where the user
+will be placed on login.
+.Pp
+The shell field is the command interpreter the user prefers.
+If there is nothing in the
+.Ar shell
+field, the Bourne shell
+.Pq Pa /bin/sh
+is assumed.
+.Sh YP SUPPORT
+If YP is active, the
+.Nm
+file also supports standard YP exclusions and inclusions, based on user
+names and netgroups.
+.Pp
+Lines beginning with a ``-'' (minus sign) are entries marked as being excluded
+from any following inclusions, which are marked with a ``+'' (plus sign).
+.Pp
+If the second character of the line is a ``@'' (at sign), the operation
+involves the user fields of all entries in the netgroup specified by the
+remaining characters of the
+.Ar name
+field.
+Otherwise, the remainder of the
+.Ar name
+field is assumed to be a specific user name.
+.Pp
+The ``+'' token may also be alone in the
+.Ar name
+field, which causes all users from the
+.Pa passwd.byname
+and
+.Pa passwd.byuid
+YP maps to be included.
+.Pp
+If the entry contains non-empty
+.Ar uid
+or
+.Ar gid
+fields, the specified numbers will override the information retrieved
+from the YP maps. As well, if the
+.Ar gecos,
+.Ar dir
+or
+.Ar shell
+entries contain text, it will override the information included via YP.
+On some systems, the
+.Ar passwd
+field may also be overriden.
+.Sh SEE ALSO
+.Xr chpass 1 ,
+.Xr login 1 ,
+.Xr passwd 1 ,
+.Xr getpwent 3 ,
+.Xr netgroup 5 ,
+.Xr adduser 8 ,
+.Xr pwd_mkdb 8 ,
+.Xr vipw 8 ,
+.Xr yp 8
+.Pp
+.%T "Managing NFS and NIS"
+(O'Reilly & Associates)
+.Sh BUGS
+User information should (and eventually will) be stored elsewhere.
+.Pp
+Placing YP exclusions in the file after any inclusions will have
+unexpected results.
+.Sh COMPATIBILITY
+The password file format has changed since 4.3BSD.
+The following awk script can be used to convert your old-style password
+file into a new style password file.
+The additional fields
+.Dq class ,
+.Dq change
+and
+.Dq expire
+are added, but are turned off by default.
+Class is currently not implemented, but change and expire are; to set them,
+use the current day in seconds from the epoch + whatever number of seconds
+of offset you want.
+.Bd -literal -offset indent
+BEGIN { FS = ":"}
+{ print $1 ":" $2 ":" $3 ":" $4 "::0:0:" $5 ":" $6 ":" $7 }
+.Ed
+.Sh HISTORY
+A
+.Nm
+file format appeared in
+.At v6 .
+.Pp
+YP file format first appeared in SunOS.
diff --git a/share/man/man5/phones.5 b/share/man/man5/phones.5
new file mode 100644
index 00000000000..35b9ac0dc4e
--- /dev/null
+++ b/share/man/man5/phones.5
@@ -0,0 +1,78 @@
+.\" $NetBSD: phones.5,v 1.3 1994/11/30 19:31:25 jtc Exp $
+.\"
+.\" Copyright (c) 1983, 1991, 1993
+.\" The Regents of the University of California. All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\" must display the following acknowledgement:
+.\" This product includes software developed by the University of
+.\" California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" @(#)phones.5 8.1 (Berkeley) 6/5/93
+.\"
+.Dd June 5, 1993
+.Dt PHONES 5
+.Os BSD 4.2
+.Sh NAME
+.Nm phones
+.Nd remote host phone number data base
+.Sh DESCRIPTION
+The file
+.Pa /etc/phones
+contains the system-wide
+private phone numbers for the
+.Xr tip 1
+program. This file is normally unreadable, and so may contain
+privileged information. The format of the file is a series of lines
+of the form: <system-name>[\ \et]*<phone-number>. The system name is
+one of those defined in the
+.Xr remote 5
+file and the phone number is constructed from any sequence of
+characters terminated only by ``,'' or the end of the line.
+The ``='' and ``*'' characters are
+indicators to the auto call units to pause and wait for a second dial
+tone (when going through an exchange). The ``='' is required by the
+.Tn DF02-AC
+and the ``*'' is required by the
+.Tn BIZCOMP
+1030.
+.Pp
+Only one phone number per line is permitted. However, if more than
+one line in the file contains the same system name
+.Xr tip 1
+will attempt to dial each one in turn, until it establishes a connection.
+.Sh FILES
+.Bl -tag -width /etc/phones -compact
+.It Pa /etc/phones
+.El
+.Sh SEE ALSO
+.Xr tip 1 ,
+.Xr remote 5
+.Sh HISTORY
+The
+.Nm
+file appeared in
+.Bx 4.2 .
diff --git a/share/man/man5/printcap.5 b/share/man/man5/printcap.5
new file mode 100644
index 00000000000..dd61121d43d
--- /dev/null
+++ b/share/man/man5/printcap.5
@@ -0,0 +1,290 @@
+.\" $NetBSD: printcap.5,v 1.4 1994/11/30 19:31:26 jtc Exp $
+.\"
+.\" Copyright (c) 1983, 1991, 1993
+.\" The Regents of the University of California. All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\" must display the following acknowledgement:
+.\" This product includes software developed by the University of
+.\" California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" @(#)printcap.5 8.2 (Berkeley) 12/11/93
+.\"
+.Dd December 11, 1993
+.Dt PRINTCAP 5
+.Os BSD 4.2
+.Sh NAME
+.Nm printcap
+.Nd printer capability data base
+.Sh SYNOPSIS
+.Nm printcap
+.Sh DESCRIPTION
+The
+.Nm Printcap
+function
+is a simplified version of the
+.Xr termcap 5
+data base
+used to describe line printers. The spooling system accesses the
+.Nm printcap
+file every time it is used, allowing dynamic
+addition and deletion of printers. Each entry in the data base
+is used to describe one printer. This data base may not be
+substituted for, as is possible for
+.Xr termcap ,
+because it may allow accounting to be bypassed.
+.Pp
+The default printer is normally
+.Em lp ,
+though the environment variable
+.Ev PRINTER
+may be used to override this. Each spooling utility supports an option,
+.Fl P Ar printer ,
+to allow explicit naming of a destination printer.
+.Pp
+Refer to the
+.%T "4.3 BSD Line Printer Spooler Manual"
+for a complete discussion on how to setup the database for a given printer.
+.Sh CAPABILITIES
+Refer to
+.Xr termcap 5
+for a description of the file layout.
+.Bl -column Name Type "/var/spool/lpd"
+.Sy Name Type Default Description
+.It "af str" Ta Dv NULL Ta No "name of accounting file"
+.It "br num none if lp is a tty, set the baud rate"
+.Pf ( Xr ioctl 2
+call)
+.It "cf str" Ta Dv NULL Ta No "cifplot data filter"
+.It "df str" Ta Dv NULL Ta No "tex data filter"
+.Pf ( Tn DVI
+format)
+.It "fc num 0 if lp is a tty, clear flag bits"
+.Pq Pa sgtty.h
+.It "ff str" Ta So Li \ef Sc Ta No "string to send for a form feed"
+.It "fo bool false print a form feed when device is opened"
+.It "fs num 0 like `fc' but set bits"
+.It "gf str" Ta Dv NULL Ta No "graph data filter"
+.Pf ( Xr plot 3
+format
+.It "hl bool false print the burst header page last"
+.It "ic bool false driver supports (non standard) ioctl to indent printout"
+.It "if str" Ta Dv NULL Ta No "name of text filter which does accounting"
+.It "lf str" Ta Pa /dev/console Ta No "error logging file name"
+.It "lo str" Ta Pa lock Ta No "name of lock file"
+.It "lp str" Ta Pa /dev/lp Ta No "device name to open for output"
+.It "mx num 1000 maximum file size (in"
+.Dv BUFSIZ
+blocks), zero = unlimited
+.It "nd str" Ta Dv NULL Ta No "next directory for list of queues (unimplemented)"
+.It "nf str" Ta Dv NULL Ta No "ditroff data filter (device independent troff)"
+.It "of str" Ta Dv NULL Ta No "name of output filtering program"
+.It "pc num 200 price per foot or page in hundredths of cents"
+.It "pl num 66 page length (in lines)"
+.It "pw num 132 page width (in characters)"
+.It "px num 0 page width in pixels (horizontal)"
+.It "py num 0 page length in pixels (vertical)"
+.It "rf str" Ta Dv NULL Ta No "filter for printing"
+.Tn FORTRAN
+style text files
+.It "rg str" Ta Dv NULL Ta No "restricted group. Only members of group allowed access"
+.It "rm str" Ta Dv NULL Ta No "machine name for remote printer"
+.It "rp str ``lp'' remote printer name argument"
+.It "rs bool false restrict remote users to those with local accounts"
+.It "rw bool false open the printer device for reading and writing"
+.It "sb bool false short banner (one line only)"
+.It "sc bool false suppress multiple copies"
+.It "sd str" Ta Pa /var/spool/lpd Ta No "spool directory"
+.It "sf bool false suppress form feeds"
+.It "sh bool false suppress printing of burst page header"
+.It "st str" Ta Pa status Ta No "status file name"
+.It "tf str" Ta Dv NULL Ta No "troff data filter (cat phototypesetter)"
+.It "tr str" Ta Dv NULL Ta No "trailer string to print when queue empties"
+.It "vf str" Ta Dv NULL Ta No "raster image filter"
+.It "xc num 0 if lp is a tty, clear local mode bits"
+.Pq Xr tty 4
+.It "xs num 0 like `xc' but set bits"
+.El
+.Pp
+If the local line printer driver supports indentation, the daemon
+must understand how to invoke it.
+.Sh FILTERS
+The
+.Xr lpd 8
+daemon creates a pipeline of
+.Em filters
+to process files for various printer types.
+The filters selected depend on the flags passed to
+.Xr lpr 1 .
+The pipeline set up is:
+.Bd -literal -offset indent
+p pr | if regular text + pr(1)
+none if regular text
+c cf cifplot
+d df DVI (tex)
+g gf plot(3)
+n nf ditroff
+f rf Fortran
+t tf troff
+v vf raster image
+.Ed
+.Pp
+The
+.Sy if
+filter is invoked with arguments:
+.Bd -filled -offset indent
+.Cm if
+.Op Fl c
+.Fl w Ns Ar width
+.Fl l Ns Ar length
+.Fl i Ns Ar indent
+.Fl n Ar login
+.Fl h Ar host acct-file
+.Ed
+.Pp
+The
+.Fl c
+flag is passed only if the
+.Fl l
+flag (pass control characters literally)
+is specified to
+.Xr lpr .
+The
+.Ar Width
+function
+and
+.Ar length
+specify the page width and length
+(from
+.Cm pw
+and
+.Cm pl
+respectively) in characters.
+The
+.Fl n
+and
+.Fl h
+parameters specify the login name and host name of the owner
+of the job respectively.
+The
+.Ar Acct-file
+function
+is passed from the
+.Cm af
+.Nm printcap
+entry.
+.Pp
+If no
+.Cm if
+is specified,
+.Cm of
+is used instead,
+with the distinction that
+.Cm of
+is opened only once,
+while
+.Cm if
+is opened for every individual job.
+Thus,
+.Cm if
+is better suited to performing accounting.
+The
+.Cm of
+is only given the
+.Ar width
+and
+.Ar length
+flags.
+.Pp
+All other filters are called as:
+.Bd -filled -offset indent
+.Nm filter
+.Fl x Ns Ar width
+.Fl y Ns Ar length
+.Fl n Ar login
+.Fl h Ar host acct-file
+.Ed
+.Pp
+where
+.Ar width
+and
+.Ar length
+are represented in pixels,
+specified by the
+.Cm px
+and
+.Cm py
+entries respectively.
+.Pp
+All filters take
+.Em stdin
+as the file,
+.Em stdout
+as the printer,
+may log either to
+.Em stderr
+or using
+.Xr syslog 3 ,
+and must not ignore
+.Dv SIGINT .
+.Sh LOGGING
+Error messages generated by the line printer programs themselves
+(that is, the
+.Xr lp Ns *
+programs)
+are logged by
+.Xr syslog 3
+using the
+.Dv LPR
+facility.
+Messages printed on
+.Em stderr
+of one of the filters
+are sent to the corresponding
+.Cm lf
+file.
+The filters may, of course, use
+.Xr syslog
+themselves.
+.Pp
+Error messages sent to the console have a carriage return and a line
+feed appended to them, rather than just a line feed.
+.Sh SEE ALSO
+.Xr termcap 5 ,
+.Xr lpc 8 ,
+.Xr lpd 8 ,
+.Xr pac 8 ,
+.Xr lpr 1 ,
+.Xr lpq 1 ,
+.Xr lprm 1
+.Rs
+.%T "4.3 BSD Line Printer Spooler Manual"
+.Re
+.Sh HISTORY
+The
+.Nm
+file format appeared in
+.Bx 4.2 ..
diff --git a/share/man/man5/protocols.5 b/share/man/man5/protocols.5
new file mode 100644
index 00000000000..64363a85ac3
--- /dev/null
+++ b/share/man/man5/protocols.5
@@ -0,0 +1,79 @@
+.\" $NetBSD: protocols.5,v 1.3 1994/11/30 19:31:27 jtc Exp $
+.\"
+.\" Copyright (c) 1983, 1991, 1993
+.\" The Regents of the University of California. All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\" must display the following acknowledgement:
+.\" This product includes software developed by the University of
+.\" California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" @(#)protocols.5 8.1 (Berkeley) 6/5/93
+.\"
+.Dd June 5, 1993
+.Dt PROTOCOLS 5
+.Os BSD 4.2
+.Sh NAME
+.Nm protocols
+.Nd protocol name data base
+.Sh DESCRIPTION
+The
+.Nm protocols
+file contains information regarding the known protocols used in the
+.Tn DARPA
+Internet. For each protocol a single line should be present
+with the following information:
+.Bd -unfilled -offset indent
+official protocol name
+protocol number
+aliases
+.Ed
+.Pp
+Items are separated by any number of blanks and/or
+tab characters. A ``#'' indicates the beginning of
+a comment; characters up to the end of the line are
+not interpreted by routines which search the file.
+.Pp
+Protocol names may contain any printable
+character other than a field delimiter, newline,
+or comment character.
+.Sh FILES
+.Bl -tag -width /etc/protocols -compact
+.It Pa /etc/protocols
+The
+.Nm protocols
+file resides in
+.Pa /etc .
+.El
+.Sh SEE ALSO
+.Xr getprotoent 3
+.Sh BUGS
+A name server should be used instead of a static file.
+.Sh HISTORY
+The
+.Nm
+file format appeared in
+.Bx 4.2 .
diff --git a/share/man/man5/remote.5 b/share/man/man5/remote.5
new file mode 100644
index 00000000000..f5b71f21e5c
--- /dev/null
+++ b/share/man/man5/remote.5
@@ -0,0 +1,202 @@
+.\" $NetBSD: remote.5,v 1.3 1994/11/30 19:31:28 jtc Exp $
+.\"
+.\" Copyright (c) 1983, 1991, 1993
+.\" The Regents of the University of California. All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\" must display the following acknowledgement:
+.\" This product includes software developed by the University of
+.\" California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" @(#)remote.5 8.1 (Berkeley) 6/5/93
+.\"
+.Dd June 5, 1993
+.Dt REMOTE 5
+.Os BSD 4.2
+.Sh NAME
+.Nm remote
+.Nd remote host description file
+.Sh DESCRIPTION
+The systems known by
+.Xr tip 1
+and their attributes are stored in an
+.Tn ASCII
+file which
+is structured somewhat like the
+.Xr termcap 5
+file. Each line in the file provides a description for a single
+.Xr system .
+Fields are separated by a colon (``:'').
+Lines ending in a \e character with an immediately following newline are
+continued on the next line.
+.Pp
+The first entry is the name(s) of the host system. If there is more
+than one name for a system, the names are separated by vertical bars.
+After the name of the system comes the fields of the description. A
+field name followed by an `=' sign indicates a string value follows. A field
+name followed by a `#' sign indicates a following numeric value.
+.Pp
+Entries named ``tip*'' and ``cu*''
+are used as default entries by
+.Xr tip ,
+and the
+.Xr cu
+interface to
+.Xr tip ,
+as follows. When
+.Xr tip
+is invoked with only a phone number, it looks for an entry
+of the form ``tip300'', where 300 is the baud rate with
+which the connection is to be made. When the
+.Xr cu
+interface is used, entries of the form ``cu300'' are used.
+.Sh CAPABILITIES
+Capabilities are either strings (str), numbers (num), or boolean
+flags (bool). A string capability is specified by
+.Em capability Ns Ar = Ns Em value ;
+for example, ``dv=/dev/harris''. A numeric capability is specified by
+.Em capability Ns Ar # Ns Em value ;
+for example, ``xa#99''. A boolean capability is specified by simply listing
+the capability.
+.Bl -tag -width indent
+.It Cm \&at
+(str)
+Auto call unit type.
+.It Cm \&br
+(num)
+The baud rate used in establishing
+a connection to the remote host.
+This is a decimal number.
+The default baud rate is 300 baud.
+.It Cm \&cm
+(str)
+An initial connection message to be sent
+to the remote host. For example, if a
+host is reached through port selector, this
+might be set to the appropriate sequence
+required to switch to the host.
+.It Cm \&cu
+(str)
+Call unit if making a phone call.
+Default is the same as the `dv' field.
+.It Cm \&di
+(str)
+Disconnect message sent to the host when a
+disconnect is requested by the user.
+.It Cm \&du
+(bool)
+This host is on a dial-up line.
+.It Cm \&dv
+(str)
+.Tn UNIX
+device(s) to open to establish a connection.
+If this file refers to a terminal line,
+.Xr tip 1
+attempts to perform an exclusive open on the device to insure only
+one user at a time has access to the port.
+.It Cm \&el
+(str)
+Characters marking an end-of-line.
+The default is
+.Dv NULL .
+`~' escapes are only
+recognized by
+.Xr tip
+after one of the characters in `el',
+or after a carriage-return.
+.It Cm \&fs
+(str)
+Frame size for transfers.
+The default frame size is equal to
+.Dv BUFSIZ .
+.It Cm \&hd
+(bool)
+The host uses half-duplex communication, local
+echo should be performed.
+.It Cm \&ie
+(str)
+Input end-of-file marks.
+The default is
+.Dv NULL .
+.It Cm \&oe
+(str)
+Output end-of-file string.
+The default is
+.Dv NULL .
+When
+.Xr tip
+is transferring a file, this
+string is sent at end-of-file.
+.It Cm \&pa
+(str)
+The type of parity to use when sending data
+to the host. This may be one of ``even'',
+``odd'', ``none'', ``zero'' (always set bit 8 to zero),
+``one'' (always set bit 8 to 1). The default
+is even parity.
+.It Cm \&pn
+(str)
+Telephone number(s) for this host.
+If the telephone number field contains
+an @ sign,
+.Xr tip
+searches the file
+.Pa /etc/phones
+file for a list of telephone numbers;
+(See
+.Xr phones 5 . )
+.It Cm \&tc
+(str)
+Indicates that the list of capabilities is continued
+in the named description. This is used
+primarily to share common capability information.
+.El
+.Pp
+Here is a short example showing the use of the capability continuation
+feature:
+.Bd -literal
+UNIX-1200:\e
+:dv=/dev/cau0:el=^D^U^C^S^Q^O@:du:at=ventel:ie=#$%:oe=^D:br#1200:
+arpavax|ax:\e
+:pn=7654321%:tc=UNIX-1200
+.Ed
+.Sh FILES
+.Bl -tag -width /etc/remote -compact
+.It Pa /etc/remote
+The
+.Nm remote
+host description file
+resides in
+.Pa /etc .
+.El
+.Sh SEE ALSO
+.Xr tip 1 ,
+.Xr phones 5
+.Sh HISTORY
+The
+.Nm
+file format appeared in
+.Bx 4.2 .
diff --git a/share/man/man5/resolv.conf.5 b/share/man/man5/resolv.conf.5
new file mode 100644
index 00000000000..3de30f557ac
--- /dev/null
+++ b/share/man/man5/resolv.conf.5
@@ -0,0 +1,224 @@
+.\" $NetBSD: resolv.conf.5,v 1.6 1994/12/12 06:13:29 deraadt Exp $
+.\"
+.\" Copyright (c) 1986, 1991 The Regents of the University of California.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\" must display the following acknowledgement:
+.\" This product includes software developed by the University of
+.\" California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" @(#)resolver.5 5.12 (Berkeley) 5/10/91
+.\"
+.Dd May 10, 1991
+.Dt RESOLV.CONF 5
+.Os BSD 4
+.Sh NAME
+.Nm resolv.conf
+.Nd resolver configuration file
+.Sh DESCRIPTION
+The
+.Nm resolv.conf
+file specifies how the
+.Xr resolver 3
+routines in the C library
+(which provide access to the Internet Domain Name System) should operate.
+The resolver configuration file contains information that is read
+by the resolver routines the first time they are invoked by a process.
+The file is designed to be human readable and contains a list of
+keywords with values that provide various types of resolver information.
+.Pp
+On a normally configured system this file should not be necessary.
+The only name server to be queried will be on the local machine,
+the domain name is determined from the host name,
+and the domain search path is constructed from the domain name.
+.Pp
+The different configuration options are:
+.Bl -tag -width nameserver
+.It Sy nameserver
+Internet address (in dot notation) of a name server
+that the resolver should query.
+Up to
+.Dv MAXNS
+(currently 3) name servers may be listed,
+one per keyword.
+If there are multiple servers,
+the resolver library queries them in the order listed.
+If no
+.Sy nameserver
+entries are present,
+the default is to use the name server on the local machine.
+(The algorithm used is to try a name server, and if the query times out,
+try the next, until out of name servers,
+then repeat trying all the name servers
+until a maximum number of retries are made).
+.It Sy domain
+Local domain name.
+Most queries for names within this domain can use short names
+relative to the local domain.
+If no
+.Sy domain
+entry is present, the domain is determined
+from the local host name returned by
+.Xr gethostname 2 ;
+the domain part is taken to be everything after the first `.'.
+Finally, if the host name does not contain a domain part, the root
+domain is assumed.
+.It Sy lookup
+This keyword is used by the library routines
+.Xr gethostbyname 3
+and
+.Xr gethostbyaddr 3 .
+It specifies which databases should be searched,
+and the order to do so.
+The legal space-separated values are
+.Bl -tag -width bind
+.It Sy bind
+use the Domain Name server by querying the
+.Xr named 8
+.It Sy file
+search for entries in
+.Nm /etc/hosts
+.It Sy yp
+talk to the YP system if
+.Xr ypbind 8
+is running
+.El
+.Pp
+If the
+.Sy lookup
+keyword is not used in the system's
+.Pa resolv.conf
+file then the assumed order is
+.Sy bind file .
+Furthermore, if the system's
+.Pa resolv.conf
+file does not exist, then the only database used is
+.Sy file .
+.Pp
+.It Sy search
+Search list for host-name lookup.
+The search list is normally determined from the local domain name;
+by default, it begins with the local domain name, then successive
+parent domains that have at least two components in their names.
+This may be changed by listing the desired domain search path
+following the
+.Sy search
+keyword with spaces or tabs separating
+the names.
+Most resolver queries will be attempted using each component
+of the search path in turn until a match is found.
+Note that this process may be slow and will generate a lot of network
+traffic if the servers for the listed domains are not local,
+and that queries will time out if no server is available
+for one of the domains.
+.Pp
+The search list is currently limited to six domains
+with a total of 256 characters.
+.It Sy sortlist
+Sortlist allows addresses returned by gethostbyname to
+be sorted.
+A sortlist is specified by IP address netmask pairs.
+The netmask is optional and defaults to the natural
+netmask of the net.
+The IP address and optional network pairs are seperated by
+slashes.
+Up to 10 pairs may be specified, ie.
+.Pp
+.Sy sortlist 130.155.160.0/255.255.240.0 130.155.0.0
+.It Sy options
+Options allows certain internal resolver variables to be modified.
+The syntax is:
+.Pp
+.Sy options option ...
+.Pp
+where option is one of the following:
+.Bl -tag -width ndots:n
+.It Sy debug
+sets RES_DEBUG in _res.options.
+.It Sy ndots:n
+sets a threshold for the number of dots which
+must appear in a name given to res_query (see
+.Xr resolver 3 )
+before an initial absolute query will be made.
+The default for n is 1, meaning that if there are any
+dots in a name, the name will be tried first as an absolute
+name before any search list elements are appended to it.
+.El
+.El
+.Pp
+The
+.Sy domain
+and
+.Sy search
+keywords are mutually exclusive.
+If more than one instance of these keywords is present,
+the last instance will override.
+.Pp
+The
+.Sy search
+keyword of a system's
+.Pa resolv.conf
+file can be overridden on a per-process basis by setting the
+environment variable
+.Ev LOCALDOMAIN
+to a space-separated list of search domains.
+.Pp
+The
+.Sy options
+keyword of a system's
+.Pa resolv.conf
+file can be amended on a per-process basis by setting the
+environment variable
+.Ev RES_OPTIONS
+to a space-separated list of resolver options as explained above.
+.Pp
+The keyword and value must appear on a single line, and the keyword
+(e.g.
+.Sy nameserver )
+must start the line. The value follows
+the keyword, separated by white space.
+.Sh FILES
+.Bl -tag -width /etc/resolv.conf -compact
+.It Pa /etc/resolv.conf
+The file
+.Nm resolv.conf
+resides in
+.Pa /etc .
+.El
+.Sh SEE ALSO
+.Xr gethostbyname 3 ,
+.Xr resolver 3 ,
+.Xr hostname 7 ,
+.Xr named 8
+.Rs
+.%T "Name Server Operations Guide for BIND"
+.Re
+.Sh HISTORY
+The
+.Nm resolv.conf
+file format appeared in
+.Bx 4.3 .
diff --git a/share/man/man5/rpc.5 b/share/man/man5/rpc.5
new file mode 100644
index 00000000000..b487b394823
--- /dev/null
+++ b/share/man/man5/rpc.5
@@ -0,0 +1,75 @@
+.\" $NetBSD: rpc.5,v 1.2 1994/11/30 19:31:30 jtc Exp $
+.\" @(#)rpc.5 2.2 88/08/03 4.0 RPCSRC; from 1.4 87/11/27 SMI;
+.\"
+.\" See the DISCLAIMER and README files in /usr/src/lib/libc/rpc for
+.\" more information about this file.
+.\"
+.Dd September 26, 1985
+.Dt RPC 5
+.Os
+.Sh NAME
+.Nm rpc
+.Nd rpc program number data base
+.Sh DESCRIPTION
+The
+.Nm rpc
+file contains user readable names that
+can be used in place of rpc program numbers.
+Each line has the following information:
+.Pp
+.Bl -item -offset indent -compact
+.It
+name of server for the rpc program
+.It
+rpc program number
+.It
+aliases
+.El
+.Pp
+Items are separated by any number of blanks and/or
+tab characters.
+A ``#'' indicates the beginning of a comment; characters up to the end of
+the line are not interpreted by routines which search the file.
+.Sh EXAMPLES
+Here is an example of the
+.Pa /etc/rpc
+file from the Sun RPC Source distribution.
+.Bd -literal -offset indent
+#
+# rpc 88/08/01 4.0 RPCSRC; from 1.12 88/02/07 SMI
+#
+portmapper 100000 portmap sunrpc
+rstatd 100001 rstat rstat_svc rup perfmeter
+rusersd 100002 rusers
+nfs 100003 nfsprog
+ypserv 100004 ypprog
+mountd 100005 mount showmount
+ypbind 100007
+walld 100008 rwall shutdown
+yppasswdd 100009 yppasswd
+etherstatd 100010 etherstat
+rquotad 100011 rquotaprog quota rquota
+sprayd 100012 spray
+3270_mapper 100013
+rje_mapper 100014
+selection_svc 100015 selnsvc
+database_svc 100016
+rexd 100017 rex
+alis 100018
+sched 100019
+llockmgr 100020
+nlockmgr 100021
+x25.inr 100022
+statmon 100023
+status 100024
+bootparam 100026
+ypupdated 100028 ypupdate
+keyserv 100029 keyserver
+tfsd 100037
+nsed 100038
+nsemntd 100039
+.Ed
+.Sh FILES
+.Pa /etc/rpc
+.Sh SEE ALSO
+.Xr getrpcent 3
diff --git a/share/man/man5/services.5 b/share/man/man5/services.5
new file mode 100644
index 00000000000..ebfa74d926e
--- /dev/null
+++ b/share/man/man5/services.5
@@ -0,0 +1,87 @@
+.\" $NetBSD: services.5,v 1.3 1994/11/30 19:31:31 jtc Exp $
+.\"
+.\" Copyright (c) 1983, 1991, 1993
+.\" The Regents of the University of California. All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\" must display the following acknowledgement:
+.\" This product includes software developed by the University of
+.\" California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" @(#)services.5 8.1 (Berkeley) 6/5/93
+.\"
+.Dd June 5, 1993
+.Dt SERVICES 5
+.Os BSD 4.2
+.Sh NAME
+.Nm services
+.Nd service name data base
+.Sh DESCRIPTION
+The
+.Nm services
+file contains information regarding
+the known services available in the
+.Tn DARPA
+Internet.
+For each service a single line should be present
+with the following information:
+.Bd -unfilled -offset indent
+official service name
+port number
+protocol name
+aliases
+.Ed
+.Pp
+Items are separated by any number of blanks and/or
+tab characters. The port number and protocol name
+are considered a single
+.Em item ;
+a ``/'' is used to
+separate the port and protocol (e.g. ``512/tcp'').
+A ``#'' indicates the beginning of
+a comment; subsequent characters up to the end of the line are
+not interpreted by the routines which search the file.
+.Pp
+Service names may contain any printable
+character other than a field delimiter, newline,
+or comment character.
+.Sh FILES
+.Bl -tag -width /etc/services -compact
+.It Pa /etc/services
+The
+.Nm services
+file resides in
+.Pa /etc .
+.El
+.Sh SEE ALSO
+.Xr getservent 3
+.Sh BUGS
+A name server should be used instead of a static file.
+.Sh HISTORY
+The
+.Nm
+file format appeared in
+.Bx 4.2 .
diff --git a/share/man/man5/shells.5 b/share/man/man5/shells.5
new file mode 100644
index 00000000000..a536ee0f4cf
--- /dev/null
+++ b/share/man/man5/shells.5
@@ -0,0 +1,67 @@
+.\" $NetBSD: shells.5,v 1.3 1994/11/30 19:31:32 jtc Exp $
+.\"
+.\" Copyright (c) 1986, 1991, 1993
+.\" The Regents of the University of California. All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\" must display the following acknowledgement:
+.\" This product includes software developed by the University of
+.\" California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" @(#)shells.5 8.1 (Berkeley) 6/5/93
+.\"
+.Dd June 5, 1993
+.Dt SHELLS 5
+.Os BSD 4.2
+.Sh NAME
+.Nm shells
+.Nd shell database
+.Sh DESCRIPTION
+The
+.Nm shells
+file contains a list of the shells on the system.
+For each shell a single line should be present, consisting of the
+shell's path, relative to root.
+.Pp
+A hash mark (``#'') indicates the beginning of a comment; subsequent
+characters up to the end of the line are not interpreted by the
+routines which search the file.
+Blank lines are also ignored.
+.Sh FILES
+.Bl -tag -width /etc/shells -compact
+.It Pa /etc/shells
+The
+.Nm shells
+file resides in
+.Pa /etc .
+.El
+.Sh SEE ALSO
+.Xr getusershell 3
+.Sh HISTORY
+The
+.Nm
+file format appeared in
+.Bx 4.3 tahoe .
diff --git a/share/man/man5/stab.5 b/share/man/man5/stab.5
new file mode 100644
index 00000000000..5003d72d8cb
--- /dev/null
+++ b/share/man/man5/stab.5
@@ -0,0 +1,224 @@
+.\" $NetBSD: stab.5,v 1.3 1994/11/30 19:31:33 jtc Exp $
+.\"
+.\" Copyright (c) 1980, 1991, 1993
+.\" The Regents of the University of California. All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\" must display the following acknowledgement:
+.\" This product includes software developed by the University of
+.\" California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" @(#)stab.5 8.1 (Berkeley) 6/5/93
+.\"
+.Dd June 5, 1993
+.Dt STAB 5
+.Os BSD 4
+.Sh NAME
+.Nm stab
+.Nd symbol table types
+.Sh SYNOPSIS
+.Fd #include <stab.h>
+.Sh DESCRIPTION
+The file
+.Aq Pa stab.h
+defines some of the symbol table
+.Fa n_type
+field values for a.out files.
+These are the types for permanent symbols (i.e. not local labels, etc.)
+used by the old debugger
+.Em sdb
+and the Berkeley Pascal compiler
+.Xr pc 1 .
+Symbol table entries can be produced by the
+.Pa .stabs
+assembler directive.
+This allows one to specify a double-quote delimited name, a symbol type,
+one char and one short of information about the symbol, and an unsigned
+long (usually an address).
+To avoid having to produce an explicit label for the address field,
+the
+.Pa .stabd
+directive can be used to implicitly address the current location.
+If no name is needed, symbol table entries can be generated using the
+.Pa .stabn
+directive.
+The loader promises to preserve the order of symbol table entries produced
+by
+.Pa .stab
+directives.
+As described in
+.Xr a.out 5 ,
+an element of the symbol table
+consists of the following structure:
+.Bd -literal
+/*
+* Format of a symbol table entry.
+*/
+
+struct nlist {
+ union {
+ char *n_name; /* for use when in-core */
+ long n_strx; /* index into file string table */
+ } n_un;
+ unsigned char n_type; /* type flag */
+ char n_other; /* unused */
+ short n_desc; /* see struct desc, below */
+ unsigned n_value; /* address or offset or line */
+};
+.Ed
+.Pp
+The low bits of the
+.Fa n_type
+field are used to place a symbol into
+at most one segment, according to
+the following masks, defined in
+.Aq Pa a.out.h .
+A symbol can be in none of these segments by having none of these segment
+bits set.
+.Bd -literal
+/*
+* Simple values for n_type.
+*/
+
+#define N_UNDF 0x0 /* undefined */
+#define N_ABS 0x2 /* absolute */
+#define N_TEXT 0x4 /* text */
+#define N_DATA 0x6 /* data */
+#define N_BSS 0x8 /* bss */
+
+#define N_EXT 01 /* external bit, or'ed in */
+.Ed
+.Pp
+The
+.Fa n_value
+field of a symbol is relocated by the linker,
+.Xr ld 1
+as an address within the appropriate segment.
+.Fa N_value
+fields of symbols not in any segment are unchanged by the linker.
+In addition, the linker will discard certain symbols, according to rules
+of its own, unless the
+.Fa n_type
+field has one of the following bits set:
+.Bd -literal
+/*
+* Other permanent symbol table entries have some of the N_STAB bits set.
+* These are given in <stab.h>
+*/
+
+#define N_STAB 0xe0 /* if any of these bits set, don't discard */
+.Ed
+.Pp
+This allows up to 112 (7 \(** 16) symbol types, split between the various
+segments.
+Some of these have already been claimed.
+The old symbolic debugger,
+.Em sdb ,
+uses the following n_type values:
+.Bd -literal
+#define N_GSYM 0x20 /* global symbol: name,,0,type,0 */
+#define N_FNAME 0x22 /* procedure name (f77 kludge): name,,0 */
+#define N_FUN 0x24 /* procedure: name,,0,linenumber,address */
+#define N_STSYM 0x26 /* static symbol: name,,0,type,address */
+#define N_LCSYM 0x28 /* .lcomm symbol: name,,0,type,address */
+#define N_RSYM 0x40 /* register sym: name,,0,type,register */
+#define N_SLINE 0x44 /* src line: 0,,0,linenumber,address */
+#define N_SSYM 0x60 /* structure elt: name,,0,type,struct_offset */
+#define N_SO 0x64 /* source file name: name,,0,0,address */
+#define N_LSYM 0x80 /* local sym: name,,0,type,offset */
+#define N_SOL 0x84 /* #included file name: name,,0,0,address */
+#define N_PSYM 0xa0 /* parameter: name,,0,type,offset */
+#define N_ENTRY 0xa4 /* alternate entry: name,linenumber,address */
+#define N_LBRAC 0xc0 /* left bracket: 0,,0,nesting level,address */
+#define N_RBRAC 0xe0 /* right bracket: 0,,0,nesting level,address */
+#define N_BCOMM 0xe2 /* begin common: name,, */
+#define N_ECOMM 0xe4 /* end common: name,, */
+#define N_ECOML 0xe8 /* end common (local name): ,,address */
+#define N_LENG 0xfe /* second stab entry with length information */
+.Ed
+.Pp
+where the comments give
+.Em sdb
+conventional use for
+.Pa .stab
+.Fa s
+and the
+.Fa n_name ,
+.Fa n_other ,
+.Fa n_desc ,
+and
+.Fa n_value
+fields
+of the given
+.Fa n_type .
+.Em Sdb
+uses the
+.Fa n_desc
+field to hold a type specifier in the form used
+by the Portable C Compiler,
+.Xr cc 1 ;
+see the header file
+.Pa pcc.h
+for details on the format of these type values.
+.Pp
+The Berkeley Pascal compiler,
+.Xr pc 1 ,
+uses the following
+.Fa n_type
+value:
+.Bd -literal
+#define N_PC 0x30 /* global pascal symbol: name,,0,subtype,line */
+.Ed
+.Pp
+and uses the following subtypes to do type checking across separately
+compiled files:
+.Bd -unfilled -offset indent
+1 source file name
+2 included file name
+3 global label
+4 global constant
+5 global type
+6 global variable
+7 global function
+8 global procedure
+9 external function
+10 external procedure
+11 library variable
+12 library routine
+.Ed
+.Sh SEE ALSO
+.Xr as 1 ,
+.Xr ld 1 ,
+.Xr dbx 1 ,
+.Xr a.out 5
+.Sh BUGS
+.Pp
+More basic types are needed.
+.Sh HISTORY
+The
+.Nm stab
+file appeared in
+.Bx 4.0 .
diff --git a/share/man/man5/types.5 b/share/man/man5/types.5
new file mode 100644
index 00000000000..b54a5369002
--- /dev/null
+++ b/share/man/man5/types.5
@@ -0,0 +1,149 @@
+.\" $NetBSD: types.5,v 1.3 1994/11/30 19:31:34 jtc Exp $
+.\"
+.\" Copyright (c) 1980, 1991, 1993
+.\" The Regents of the University of California. All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\" must display the following acknowledgement:
+.\" This product includes software developed by the University of
+.\" California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" @(#)types.5 8.1 (Berkeley) 6/5/93
+.\"
+.Dd June 5, 1993
+.Dt TYPES 5
+.Os BSD 4
+.Sh NAME
+.Nm types
+.Nd system data types
+.Sh SYNOPSIS
+.Fd #include <sys/types.h>
+.Sh DESCRIPTION
+The file
+.Pa sys/types.h
+contains the defined data types used in the kernel (most are
+used through out the system).
+.Bd -literal
+#ifndef _TYPES_H_
+#define _TYPES_H_
+
+typedef short dev_t;
+#ifndef _POSIX_SOURCE
+ /* major part of a device */
+#define major(x) ((int)(((unsigned)(x)>>8)&0377))
+ /* minor part of a device */
+#define minor(x) ((int)((x)&0377))
+ /* make a device number */
+#define makedev(x,y) ((dev_t)(((x)<<8) | (y)))
+#endif
+
+typedef unsigned char u_char;
+typedef unsigned short u_short;
+typedef unsigned int u_int;
+typedef unsigned long u_long;
+typedef unsigned short ushort; /* Sys V compatibility */
+
+#include <machine/ansi.h>
+#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
+#include <machine/types.h>
+#endif
+
+#ifdef _CLOCK_T_
+typedef _CLOCK_T_ clock_t;
+#undef _CLOCK_T_
+#endif
+
+#ifdef _SIZE_T_
+typedef _SIZE_T_ size_t;
+#undef _SIZE_T_
+#endif
+
+#ifdef _TIME_T_
+typedef _TIME_T_ time_t;
+#undef _TIME_T_
+#endif
+
+#ifndef _POSIX_SOURCE
+typedef struct _uquad { unsigned long val[2]; } u_quad;
+typedef struct _quad { long val[2]; } quad;
+#endif
+typedef long * qaddr_t; /* should be typedef quad * qaddr_t; */
+
+typedef long daddr_t;
+typedef char * caddr_t;
+typedef u_long ino_t;
+typedef long swblk_t;
+typedef long segsz_t;
+typedef long off_t;
+typedef u_short uid_t;
+typedef u_short gid_t;
+typedef short pid_t;
+typedef u_short nlink_t;
+typedef u_short mode_t;
+typedef u_long fixpt_t;
+
+#ifndef _POSIX_SOURCE
+#define NBBY 8 /* number of bits in a byte */
+
+/*
+ * Select uses bit masks of file descriptors in longs. These macros
+ * manipulate such bit fields (the filesystem macros use chars).
+ * FD_SETSIZE may be defined by the user, but the default here should
+ * be >= NOFILE (param.h).
+ */
+#ifndef FD_SETSIZE
+#define FD_SETSIZE 256
+#endif
+
+typedef long fd_mask;
+#define NFDBITS (sizeof(fd_mask) * NBBY) /* bits per mask */
+
+#ifndef howmany
+#define howmany(x, y) (((x)+((y)-1))/(y))
+#endif
+
+typedef struct fd_set {
+ fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)];
+} fd_set;
+
+#define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS)))
+#define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS)))
+#define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS)))
+#define FD_ZERO(p) bzero((char *)(p), sizeof(*(p)))
+
+#endif /* !_POSIX_SOURCE */
+#endif /* !_TYPES_H_ */
+.Ed
+.Sh SEE ALSO
+.Xr fs 5 ,
+.Xr time 3 ,
+.Xr lseek 2 ,
+.Xr adb 1
+.Sh HISTORY
+A
+.Nm
+file appeared in
+.At v7 .
diff --git a/share/man/man5/utmp.5 b/share/man/man5/utmp.5
new file mode 100644
index 00000000000..bbfa03a3927
--- /dev/null
+++ b/share/man/man5/utmp.5
@@ -0,0 +1,220 @@
+.\" $NetBSD: utmp.5,v 1.5 1994/11/30 19:31:35 jtc Exp $
+.\"
+.\" Copyright (c) 1980, 1991, 1993
+.\" The Regents of the University of California. All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\" must display the following acknowledgement:
+.\" This product includes software developed by the University of
+.\" California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" @(#)utmp.5 8.2 (Berkeley) 3/17/94
+.\"
+.Dd March 17, 1994
+.Dt UTMP 5
+.Os BSD 4
+.Sh NAME
+.Nm utmp ,
+.Nm wtmp ,
+.Nm lastlog
+.Nd login records
+.Sh SYNOPSIS
+.Fd #include <utmp.h>
+.Sh DESCRIPTION
+The file
+.Aq Pa utmp.h
+declares the structures used to record information about current
+users in the file
+.Nm utmp ,
+logins and logouts in the file
+.Nm wtmp ,
+and last logins in the file
+.Nm lastlog .
+The time stamps of date changes, shutdowns and reboots are also logged in
+the
+.Nm wtmp
+file.
+.Pp
+These files can grow rapidly on busy systems, daily or weekly rotation
+is recommended.
+If any of these files do not exist, it is not created.
+These
+files must be created manually and are normally maintained in either the script
+.Pa /etc/daily
+or the script
+.Pa /etc/weekly .
+(See
+.Xr cron 8 . )
+.Bd -literal -offset indent
+#define _PATH_UTMP "/var/run/utmp"
+#define _PATH_WTMP "/var/log/wtmp"
+#define _PATH_LASTLOG "/var/log/lastlog"
+
+#define UT_NAMESIZE 8
+#define UT_LINESIZE 8
+#define UT_HOSTSIZE 16
+
+struct lastlog {
+ time_t ll_time;
+ char ll_line[UT_LINESIZE];
+ char ll_host[UT_HOSTSIZE];
+};
+
+struct utmp {
+ char ut_line[UT_LINESIZE];
+ char ut_name[UT_NAMESIZE];
+ char ut_host[UT_HOSTSIZE];
+ time_t ut_time;
+};
+.Ed
+.Pp
+Each time a user logs in, the
+.Xr login
+program looks up the user's
+.Tn UID
+in the file
+.Nm lastlog.
+If it is found, the timestamp of the last time the user logged
+in, the terminal line and the hostname
+are written to the standard output. (Providing the login is not
+.Em quiet ,
+see
+.Xr login 1 . )
+The
+.Xr login
+program then records the new login time in the file
+.Nm lastlog .
+.Pp
+After the new
+.Fa lastlog
+record is written ,
+.\" the
+.\" .Xr libutil 3
+.\" routine
+the file
+.Nm utmp
+is opened and the
+.Fa utmp
+record for the user inserted.
+This record remains there until
+the user logs out at which time it is deleted.
+The
+.Nm utmp
+file is used by the programs
+.Xr rwho 1 ,
+.Xr users 1 ,
+.Xr w 1 ,
+and
+.Xr who 1 .
+.Pp
+Next, the
+.Xr login
+program opens the file
+.Nm wtmp ,
+and appends the user's
+.Fa utmp
+record.
+The same
+.Fa utmp
+record, with an updated time stamp is later appended
+to the file when the user logs out. (See
+.Xr init 8 . )
+The
+.Nm wtmp
+file is used by the programs
+.Xr last 1
+and
+.Xr ac 8 .
+.Pp
+In the event of a date change, a shutdown or reboot, the
+following items are logged in the
+.Nm wtmp
+file.
+.Pp
+.Bl -tag -width shutdownxx -compact
+.It Li reboot
+.It Li shutdown
+A system reboot or shutdown has been initiated.
+The character
+.Ql \&~
+is placed in the field
+.Fa ut_line ,
+and
+.Li reboot
+or
+.Li shutdown
+in the field
+.Fa ut_name .
+(See
+.Xr shutdown 8
+and
+.Xr reboot 8 . )
+.Pp
+.It Li date
+The system time has been manually or automatically updated.
+(See
+.Xr date 1 . )
+The command name
+.Xr date
+is recorded in the field
+.Fa ut_name .
+In the field
+.Fa ut_line ,
+the character
+.Ql \\*(Ba
+indicates the time prior to the change, and the character
+.Ql \&{
+indicates the new time.
+.El
+.Sh FILES
+.Bl -tag -width /var/log/lastlog -compact
+.It Pa /var/run/utmp
+The
+.Nm utmp file.
+.It Pa /var/log/wtmp
+The
+.Nm wtmp file.
+.It Pa /var/log/lastlog
+The
+.Nm lastlog file.
+.El
+.Sh SEE ALSO
+.Xr last 1 ,
+.Xr login 1 ,
+.Xr who 1 ,
+.Xr ac 8 ,
+.Xr init 8
+.Sh HISTORY
+A
+.Nm utmp
+and
+.Nm wtmp
+file format appeared in
+.At v6 .
+The
+.Nm lastlog
+file format appeared in
+.Bx 3.0 .