386BSD 0.1 development
authorWilliam F. Jolitz <wjolitz@soda.berkeley.edu>
Mon, 29 Apr 1991 11:31:51 +0000 (03:31 -0800)
committerWilliam F. Jolitz <wjolitz@soda.berkeley.edu>
Mon, 29 Apr 1991 11:31:51 +0000 (03:31 -0800)
Work on file usr/othersrc/share/man/man5/fs.5
Work on file usr/othersrc/share/man/man5/passwd.5
Work on file usr/othersrc/share/man/man5/types.5
Work on file usr/othersrc/share/man/man5/acct.5
Work on file usr/othersrc/share/man/man5/a.out.5
Work on file usr/othersrc/share/man/man5/dir.5
Work on file usr/othersrc/share/man/man5/group.5
Work on file usr/othersrc/share/man/man5/core.5

Co-Authored-By: Lynne Greer Jolitz <ljolitz@cardio.ucsf.edu>
Synthesized-from: 386BSD-0.1

usr/othersrc/share/man/man5/a.out.5 [new file with mode: 0644]
usr/othersrc/share/man/man5/acct.5 [new file with mode: 0644]
usr/othersrc/share/man/man5/core.5 [new file with mode: 0644]
usr/othersrc/share/man/man5/dir.5 [new file with mode: 0644]
usr/othersrc/share/man/man5/fs.5 [new file with mode: 0644]
usr/othersrc/share/man/man5/group.5 [new file with mode: 0644]
usr/othersrc/share/man/man5/passwd.5 [new file with mode: 0644]
usr/othersrc/share/man/man5/types.5 [new file with mode: 0644]

diff --git a/usr/othersrc/share/man/man5/a.out.5 b/usr/othersrc/share/man/man5/a.out.5
new file mode 100644 (file)
index 0000000..2c23aad
--- /dev/null
@@ -0,0 +1,396 @@
+.\" Copyright (c) 1991 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     6.3 (Berkeley) 4/29/91
+.\"
+.Dd April 29, 1991
+.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 short  a_mid;
+       unsigned short  a_magic;
+       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_mid
+Contains a bit pattern that
+identifies binaries that were built for
+certain sub-classes of an architecture
+.Pq Sq machine IDs
+or variants of the operating system on a given architecture.
+The kernel may not support all machine IDs
+on a given architecture.
+The
+.Fa a_mid
+field is not present on some architectures;
+in this case, the
+.Fa a_magic
+field has type
+.Em unsigned long .
+.It Fa a_magic
+Contains a bit pattern
+.Pq Sq magic number
+that 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,
+                       : 4;
+};
+.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.
+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.
+.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 is currently unused.
+.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 ld 1 ,
+.Xr execve 2 ,
+.Xr nlist 3 ,
+.Xr core 5 ,
+.Xr dbx 5 ,
+.Xr stab 5
+.Sh HISTORY
+The
+.Pa a.out.h
+include file appeared in
+.At v7 .
+.Sh BUGS
+Since not all of the supported architectures use the
+.Fa a_mid
+field,
+it can be difficult to determine what
+architecture a binary will execute on
+without examining its actual machine code.
+Even with a machine identifier,
+the byte order of the
+.Fa exec
+header is machine-dependent.
+.Pp
+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/usr/othersrc/share/man/man5/acct.5 b/usr/othersrc/share/man/man5/acct.5
new file mode 100644 (file)
index 0000000..21ea5f5
--- /dev/null
@@ -0,0 +1,110 @@
+.\" Copyright 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.
+.\"
+.\"     @(#)acct.5     6.3 (Berkeley) 4/29/91
+.\"
+.Dd April 29, 1991
+.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/usr/othersrc/share/man/man5/core.5 b/usr/othersrc/share/man/man5/core.5
new file mode 100644 (file)
index 0000000..6df18aa
--- /dev/null
@@ -0,0 +1,111 @@
+.\" Copyright (c) 1980, 1991 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     6.3 (Berkeley) 4/29/91
+.\"
+.Dd April 29, 1991
+.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 aviailable debuggers.
+(See
+.Xr sigaction 2 . )
+This memory image is written to a file named
+.Nm core
+in the working directory;
+provided the terminated process had write permission in the directory,
+and provided the abnormality did not caused
+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 core
+file is limited by
+.Xr setrlimit 2 .
+Files which would be larger than the limit are not created.
+.Pp
+The
+.Nm 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 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 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
+file format appeared in
+.At v6 .
diff --git a/usr/othersrc/share/man/man5/dir.5 b/usr/othersrc/share/man/man5/dir.5
new file mode 100644 (file)
index 0000000..354f83d
--- /dev/null
@@ -0,0 +1,151 @@
+.\" Copyright (c) 1983, 1991 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      6.2 (Berkeley) 4/29/91
+.\"
+.Dd April 29, 1991
+.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 convienent 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 contain
+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 refered 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/usr/othersrc/share/man/man5/fs.5 b/usr/othersrc/share/man/man5/fs.5
new file mode 100644 (file)
index 0000000..a052dca
--- /dev/null
@@ -0,0 +1,342 @@
+.\" Copyright (c) 1983, 1991 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       6.4 (Berkeley) 4/29/91
+.\"
+.Dd April 29, 1991
+.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 rotaional 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/usr/othersrc/share/man/man5/group.5 b/usr/othersrc/share/man/man5/group.5
new file mode 100644 (file)
index 0000000..9a53967
--- /dev/null
@@ -0,0 +1,123 @@
+.\" Copyright 1980, 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.
+.\"
+.\"     @(#)group.5    6.2 (Berkeley) 4/29/91
+.\"
+.Dd April 29, 1991
+.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 priviledges of
+.Ar group .
+The member names are separated by commas with out 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 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
+.Sh BUGS
+The
+.Xr passwd 1
+command does not change the
+.Nm group
+passwords.
+.Sh HISTORY
+A
+.Nm
+file format appeared in
+.At v6 .
diff --git a/usr/othersrc/share/man/man5/passwd.5 b/usr/othersrc/share/man/man5/passwd.5
new file mode 100644 (file)
index 0000000..e46611b
--- /dev/null
@@ -0,0 +1,169 @@
+.\" Copyright (c) 1988, 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.
+.\"
+.\"     @(#)passwd.5   6.7 (Berkeley) 4/29/91
+.\"
+.Dd April 29, 1991
+.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 SEE ALSO
+.Xr chpass 1 ,
+.Xr login 1 ,
+.Xr passwd 1 ,
+.Xr getpwent 3 ,
+.Xr mkpasswd 8 ,
+.Xr vipw 8
+.Xr adduser 8
+.Sh BUGS
+User information should (and eventually will) be stored elsewhere.
+.Sh HISTORY
+A
+.Nm
+file format appeared in
+.At v6 .
diff --git a/usr/othersrc/share/man/man5/types.5 b/usr/othersrc/share/man/man5/types.5
new file mode 100644 (file)
index 0000000..e1789e8
--- /dev/null
@@ -0,0 +1,147 @@
+.\" Copyright (c) 1980, 1991 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    6.2 (Berkeley) 4/29/91
+.\"
+.Dd April 29, 1991
+.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 .