*BSD News Article 61013


Return to BSD News archive

Newsgroups: comp.bugs.2bsd
Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.cs.su.oz.au!inferno.mpx.com.au!news.unimelb.EDU.AU!munnari.OZ.AU!news.hawaii.edu!ames!usenet.kornet.nm.kr!news.kreonet.re.kr!usenet.seri.re.kr!news.cais.net!ringer.cs.utsa.edu!swrinde!cssun.mathcs.emory.edu!gatech!news.mathworks.com!uunet!in2.uu.net!news.new-york.net!wlbr!sms
From: sms@wlv.iipo.gtegsc.com (Steven M. Schultz)
Subject: mount(8) options, !/etc/mtab, libkern.a, MANY others (#294 part 3 of 8)
Sender: news@wlbr.iipo.gtegsc.com (Steven M. Schultz)
Organization: GTE Government Systems, Thousand Oaks CA USA
Message-ID: <DM4rpH.LzF@wlbr.iipo.gtegsc.com>
X-Nntp-Posting-Host: wlv.iipo.gtegsc.com
Date: Fri, 2 Feb 1996 04:12:53 GMT
Lines: 2160

Subject: mount(8) options, !/etc/mtab, libkern.a, MANY others (#294 part 3 of 8)
Index:	many/many 2.11BSD

Description:
	Mount(8) does not pass options other than 'readonly' thru to the
	kernel even though the kernel understands many more options than
	that.

	/etc/mtab is not needed any longer because applications (mount, umount,
	others) can obtain the list of mounted filesystems via getmntinfo(3),
	or getfsstat(2)

	There are copies of 15 libc routines in the kernel directories.  These
	are invariant but nevertheless are always being recompiled/assembled
	whenever a kernel is built.

Repeat-By:
	It sounds inadequate, but, "observation".

Fix:
	This is #294 (part 3 of 8).

	Please refer to part 1 (#292) for detailed instructions and a
	description of contents.

----------------------------cut here-------------------------
#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create:
#	/usr/include/fstab.h
#	/usr/include/limits.h
#	/usr/include/strings.h
#	/usr/include/unistd.h
#	/usr/src/man/man3/getopt.3
#	/usr/src/man/man3/getsubopt.3
#	/usr/src/man/man3/strcspn.3
#	/usr/src/man/man3/strpbrk.3
#	/usr/src/man/man3/strsep.3
#	/usr/src/man/man3/strspn.3
#	/usr/src/man/man3/strstr.3
#	/usr/src/man/man3/strtok.3
#	/usr/src/man/man3/strtol.3
#	/usr/src/man/man3/strtoul.3
#	/usr/src/man/man5/fstab.5
#	/usr/src/man/man8/quotaon.8
#	/usr/src/sys/pdp/limits.h
# This archive created: Tue Jan 30 21:08:01 1996
export PATH; PATH=/bin:/usr/bin:$PATH
if test -f '/usr/include/fstab.h'
then
	echo shar: "will not over-write existing file '/usr/include/fstab.h'"
else
sed 's/^X//' << \SHAR_EOF > '/usr/include/fstab.h'
X/*
X * Copyright (c) 1980, 1993
X *	The Regents of the University of California.  All rights reserved.
X *
X * Redistribution and use in source and binary forms, with or without
X * modification, are permitted provided that the following conditions
X * are met:
X * 1. Redistributions of source code must retain the above copyright
X *    notice, this list of conditions and the following disclaimer.
X * 2. Redistributions in binary form must reproduce the above copyright
X *    notice, this list of conditions and the following disclaimer in the
X *    documentation and/or other materials provided with the distribution.
X * 3. All advertising materials mentioning features or use of this software
X *    must display the following acknowledgement:
X *	This product includes software developed by the University of
X *	California, Berkeley and its contributors.
X * 4. Neither the name of the University nor the names of its contributors
X *    may be used to endorse or promote products derived from this software
X *    without specific prior written permission.
X *
X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
X * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
X * SUCH DAMAGE.
X *
X *	@(#)fstab.h	8.1.1 (2.11BSD) 1996/1/15
X */
X
X#ifndef _FSTAB_H_
X#define _FSTAB_H_
X
X/*
X * File system table, see fstab(5).
X *
X * Used by dump, mount, umount, swapon, fsck, df, ...
X *
X * For ufs fs_spec field is the block special name.  Programs that want to
X * use the character special name must create that name by prepending a 'r'
X * after the right most slash.  Quota files are always named "quotas", so
X * if type is "rq", then use concatenation of fs_file and "quotas" to locate
X * quota file.
X */
X#define	_PATH_FSTAB	"/etc/fstab"
X#define	FSTAB		"/etc/fstab"	/* deprecated */
X
X#define	FSTAB_RW	"rw"		/* read/write device */
X#define	FSTAB_RQ	"rq"		/* read/write with quotas */
X#define	FSTAB_RO	"ro"		/* read-only device */
X#define	FSTAB_SW	"sw"		/* swap device */
X#define	FSTAB_XX	"xx"		/* ignore totally */
X
Xstruct fstab {
X	char	*fs_spec;		/* block special device name */
X	char	*fs_file;		/* file system path prefix */
X	char	*fs_vfstype;		/* File system type, ufs, nfs */
X	char	*fs_mntops;		/* Mount options ala -o */
X	char	*fs_type;		/* FSTAB_* from fs_mntops */
X	int	fs_freq;		/* dump frequency, in days */
X	int	fs_passno;		/* pass number on parallel dump */
X};
X
Xstruct fstab *getfsent();
Xstruct fstab *getfsspec();
Xstruct fstab *getfsfile();
Xint setfsent();
Xvoid endfsent();
X
X#endif /* !_FSTAB_H_ */
SHAR_EOF
chmod 444 '/usr/include/fstab.h'
fi
if test -f '/usr/include/limits.h'
then
	echo shar: "will not over-write existing file '/usr/include/limits.h'"
else
sed 's/^X//' << \SHAR_EOF > '/usr/include/limits.h'
X/*
X * Copyright (c) 1988, 1993
X *	The Regents of the University of California.  All rights reserved.
X *
X * Redistribution and use in source and binary forms, with or without
X * modification, are permitted provided that the following conditions
X * are met:
X * 1. Redistributions of source code must retain the above copyright
X *    notice, this list of conditions and the following disclaimer.
X * 2. Redistributions in binary form must reproduce the above copyright
X *    notice, this list of conditions and the following disclaimer in the
X *    documentation and/or other materials provided with the distribution.
X * 3. All advertising materials mentioning features or use of this software
X *    must display the following acknowledgement:
X *	This product includes software developed by the University of
X *	California, Berkeley and its contributors.
X * 4. Neither the name of the University nor the names of its contributors
X *    may be used to endorse or promote products derived from this software
X *    without specific prior written permission.
X *
X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
X * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
X * SUCH DAMAGE.
X *
X *	@(#)limits.h	8.2.1 (2.11BSD) 1996/1/11
X */
X
X#ifndef _LIMITS_H_
X#define	_LIMITS_H_
X
X/*
X * We don't need this crud at the moment so save on abuse of the C
X * preprocessor by not doing the defines.
X
X#define	_POSIX_ARG_MAX		4096
X#define	_POSIX_CHILD_MAX	6
X#define	_POSIX_LINK_MAX		8
X#define	_POSIX_MAX_CANON	255
X#define	_POSIX_MAX_INPUT	255
X#define	_POSIX_NAME_MAX		14
X#define	_POSIX_NGROUPS_MAX	0
X#define	_POSIX_OPEN_MAX		16
X#define	_POSIX_PATH_MAX		255
X#define	_POSIX_PIPE_BUF		512
X#define	_POSIX_SSIZE_MAX	32767
X#define	_POSIX_STREAM_MAX	8
X#define	_POSIX_TZNAME_MAX	3
X
X#define	_POSIX2_BC_BASE_MAX	99
X#define	_POSIX2_BC_DIM_MAX	2048
X#define	_POSIX2_BC_SCALE_MAX	99
X#define	_POSIX2_BC_STRING_MAX	1000
X#define	_POSIX2_EQUIV_CLASS_MAX	2
X#define	_POSIX2_EXPR_NEST_MAX	32
X#define	_POSIX2_LINE_MAX	2048
X#define	_POSIX2_RE_DUP_MAX	255
X
X*/
X
X#include <machine/limits.h>
X/* #include <sys/syslimits.h> */
X
X#endif /* !_LIMITS_H_ */
SHAR_EOF
chmod 444 '/usr/include/limits.h'
fi
if test -f '/usr/include/strings.h'
then
	echo shar: "will not over-write existing file '/usr/include/strings.h'"
else
sed 's/^X//' << \SHAR_EOF > '/usr/include/strings.h'
X/*-
X * Copyright (c) 1990, 1993
X *	The Regents of the University of California.  All rights reserved.
X *
X * Redistribution and use in source and binary forms, with or without
X * modification, are permitted provided that the following conditions
X * are met:
X * 1. Redistributions of source code must retain the above copyright
X *    notice, this list of conditions and the following disclaimer.
X * 2. Redistributions in binary form must reproduce the above copyright
X *    notice, this list of conditions and the following disclaimer in the
X *    documentation and/or other materials provided with the distribution.
X * 3. All advertising materials mentioning features or use of this software
X *    must display the following acknowledgement:
X *	This product includes software developed by the University of
X *	California, Berkeley and its contributors.
X * 4. Neither the name of the University nor the names of its contributors
X *    may be used to endorse or promote products derived from this software
X *    without specific prior written permission.
X *
X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
X * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
X * SUCH DAMAGE.
X *
X *	@(#)strings.h	8.1 (Berkeley) 6/2/93
X */
X
X#include <string.h>
SHAR_EOF
chmod 444 '/usr/include/strings.h'
fi
if test -f '/usr/include/unistd.h'
then
	echo shar: "will not over-write existing file '/usr/include/unistd.h'"
else
sed 's/^X//' << \SHAR_EOF > '/usr/include/unistd.h'
X/*-
X * Copyright (c) 1991, 1993, 1994
X *	The Regents of the University of California.  All rights reserved.
X *
X * Redistribution and use in source and binary forms, with or without
X * modification, are permitted provided that the following conditions
X * are met:
X * 1. Redistributions of source code must retain the above copyright
X *    notice, this list of conditions and the following disclaimer.
X * 2. Redistributions in binary form must reproduce the above copyright
X *    notice, this list of conditions and the following disclaimer in the
X *    documentation and/or other materials provided with the distribution.
X * 3. All advertising materials mentioning features or use of this software
X *    must display the following acknowledgement:
X *	This product includes software developed by the University of
X *	California, Berkeley and its contributors.
X * 4. Neither the name of the University nor the names of its contributors
X *    may be used to endorse or promote products derived from this software
X *    without specific prior written permission.
X *
X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
X * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
X * SUCH DAMAGE.
X *
X *	@(#)unistd.h	8.10.1 (2.11BSD) 1996/1/12
X */
X
X/*
X * Modified for 2.11BSD by removing prototypes.  To save time and space
X * functions not returning 'int' and functions not present in the system
X * are not listed.
X*/
X
X#ifndef _UNISTD_H_
X#define	_UNISTD_H_
X
X#include <sys/types.h>
X/* #include <sys/unistd.h> */
X
X#define	 STDIN_FILENO	0	/* standard input file descriptor */
X#define	STDOUT_FILENO	1	/* standard output file descriptor */
X#define	STDERR_FILENO	2	/* standard error file descriptor */
X
X#ifndef NULL
X#define	NULL		0	/* null pointer constant */
X#endif
X
Xvoid	 _exit();
Xunsigned int	 access();
Xunsigned int	 alarm();
Xpid_t	 fork();
Xgid_t	 getegid();
Xuid_t	 geteuid();
Xgid_t	 getgid();
Xchar	*getlogin();
Xpid_t	 getpgrp();
Xpid_t	 getpid();
Xpid_t	 getppid();
Xuid_t	 getuid();
Xoff_t	 lseek();
Xssize_t	 read();
Xunsigned int	 sleep();
Xchar	*ttyname();
Xssize_t	 write();
X
Xchar	*brk();
Xchar	*crypt();
Xvoid	 endusershell();
Xlong	 gethostid();
Xchar	*getpass();
Xchar	*getusershell();
Xchar	*getwd();
Xchar	*mktemp();
Xvoid	 psignal();
Xextern	char 	*sys_siglist[];
Xchar	*re_comp();
Xchar	*sbrk();
Xvoid	 sethostid();
Xvoid	 setusershell();
Xvoid	 sync();
Xunsigned int	 ualarm();
Xvoid	 usleep();
Xpid_t	 vfork();
X
X#endif /* !_UNISTD_H_ */
SHAR_EOF
chmod 444 '/usr/include/unistd.h'
fi
if test -f '/usr/src/man/man3/getopt.3'
then
	echo shar: "will not over-write existing file '/usr/src/man/man3/getopt.3'"
else
sed 's/^X//' << \SHAR_EOF > '/usr/src/man/man3/getopt.3'
X.\" Copyright (c) 1988, 1991, 1993
X.\"	The Regents of the University of California.  All rights reserved.
X.\"
X.\" Redistribution and use in source and binary forms, with or without
X.\" modification, are permitted provided that the following conditions
X.\" are met:
X.\" 1. Redistributions of source code must retain the above copyright
X.\"    notice, this list of conditions and the following disclaimer.
X.\" 2. Redistributions in binary form must reproduce the above copyright
X.\"    notice, this list of conditions and the following disclaimer in the
X.\"    documentation and/or other materials provided with the distribution.
X.\" 3. All advertising materials mentioning features or use of this software
X.\"    must display the following acknowledgement:
X.\"	This product includes software developed by the University of
X.\"	California, Berkeley and its contributors.
X.\" 4. Neither the name of the University nor the names of its contributors
X.\"    may be used to endorse or promote products derived from this software
X.\"    without specific prior written permission.
X.\"
X.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
X.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
X.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
X.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
X.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
X.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
X.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
X.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
X.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
X.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
X.\" SUCH DAMAGE.
X.\"
X.\"     @(#)getopt.3	8.4.1 (2.11BSD) 1996/1/12
X.\"
X.TH GETOPT 3 "January 12, 1996"
X.UC 6
X.SH NAME
X\fBgetopt\fP \- get option character from command line argument list
X.SH SYNOPSIS
X.B #include <stdlib.h>
X.sp
X.B extern char *optarg;
X.br
X.B extern int   optind;
X.br
X.B extern int   optopt;
X.br
X.B extern int   opterr;
X.br
X.B extern int   optreset;
X.sp
X.I int
X.br
X\fBgetopt\fP(argc, argv, optstring)
X.br
X.I int argc;
X.br
X.I char **argv;
X.br
X.I char *optstring;
X.SH DESCRIPTION
XThe
X.BR getopt ()
Xfunction incrementally parses a command line argument list
X.I argv
Xand returns the next
X.I known
Xoption character.
XAn option character is
X.I known
Xif it has been specified in the string of accepted option characters,
X.IR optstring .
X.PP
XThe option string
X.I optstring
Xmay contain the following elements: individual characters, and
Xcharacters followed by a colon to indicate an option argument
Xis to follow.
XFor example, an option string
X"\&""x""
Xrecognizes an option
X``\-\fBx\fP'',
Xand an option string
X"\&""x:""
Xrecognizes an option and argument
X``\fB\-x\fP \fIargument\fP''.
XIt does not matter to
X.BR getopt ()
Xif a following argument has leading white space.
X.PP
XOn return from
X.BR getopt (),
X.I optarg
Xpoints to an option argument, if it is anticipated,
Xand the variable
X.I optind
Xcontains the index to the next
X.I argv
Xargument for a subsequent call
Xto
X.BR getopt ().
XThe variable
X.I optopt
Xsaves the last
X.I known
Xoption character returned by
X.BR getopt ().
X.PP
XThe variable
X.I opterr
Xand
X.I optind
Xare both initialized to 1.
XThe
X.I optind
Xvariable may be set to another value before a set of calls to
X.BR getopt ()
Xin order to skip over more or less argv entries.
X.PP
XIn order to use
X.BR getopt ()
Xto evaluate multiple sets of arguments, or to evaluate a single set of
Xarguments multiple times,
Xthe variable
X.I optreset
Xmust be set to 1 before the second and each additional set of calls to
X.BR getopt (),
Xand the variable
X.I optind
Xmust be reinitialized.
X.PP
XThe
X.BR getopt ()
Xfunction
Xreturns an
X.B EOF
Xwhen the argument list is exhausted, or a non-recognized
Xoption is encountered.
XThe interpretation of options in the argument list may be cancelled
Xby the option `\-\-'
X(double dash) which causes
X.BR getopt ()
Xto signal the end of argument processing and return an
X.BR EOF . 
XWhen all options have been processed (i.e., up to the first non-option
Xargument),
X.BR getopt ()
Xreturns
X.BR EOF .
X.SH DIAGNOSTICS
XIf the
X.BR getopt ()
Xfunction encounters a character not found in the string
X.I optarg
Xor detects
Xa missing option argument it writes an error message and returns `?'
Xto the
X.IR stderr .
XSetting
X.I opterr
Xto a zero will disable these error messages.
XIf
X.I optstring 
Xhas a leading 
X`\&:'
Xthen a missing option argument causes a
X`\&:'
Xto be returned in addition to suppressing any error messages.
X.PP
XOption arguments are allowed to begin with
X`\-';
Xthis is reasonable but
Xreduces the amount of error checking possible.
X.SH EXTENSIONS
XThe
X.I optreset
Xvariable was added to make it possible to call the
X.BR getopt ()
Xfunction multiple times.
XThis is an extension to the
XIEEE Std1003.2 (``POSIX'')
Xspecification.
X.SH EXAMPLE
X.nf
X.cs R 24
Xextern char *optarg;
Xextern int optind;
Xint bflag, ch, fd;
X
Xbflag = 0;
Xwhile ((ch = getopt(argc, argv, "bf:")) != EOF)
X	switch(ch) {
X	case 'b':
X		bflag = 1;
X		break;
X	case 'f':
X		if ((fd = open(optarg, O_RDONLY, 0)) < 0) {
X			(void)fprintf(stderr,
X			    "myname: %s: %s\en", optarg, strerror(errno));
X			exit(1);
X		}
X		break;
X	case '?':
X	default:
X		usage();
X}
Xargc -= optind;
Xargv += optind;
X.br
X.cs R
X.fi
X.SH HISTORY
XThe
X.BR getopt ()
Xfunction appeared 4.3BSD.
X.SH BUGS
XA single dash ``\-''
Xmay be specified as an character in
X.I optstring ,
Xhowever it should
X.B never
Xhave an argument associated with it.
XThis allows
X.BR getopt ()
Xto be used with programs that expect
X``\-''
Xas an option flag.
XThis practice is wrong, and should not be used in any current development.
XIt is provided for backward compatibility
X.B only .
XBy default, a single dash causes
X.BR getopt ()
Xto return
X.BR EOF .
XThis is, we believe, compatible with System V.
X.PP
XIt is also possible to handle digits as option letters.
XThis allows
X.BR getopt ()
Xto be used with programs that expect a number
X(``-3'')
Xas an option.
XThis practice is wrong, and should not be used in any current development.
XIt is provided for backward compatibility
X.BR only .
XThe following code fragment works in most cases.
X.sp
X.nf
X.cs R 24
Xint length;
Xchar *p;
X
Xwhile ((c = getopt(argc, argv, "0123456789")) != EOF)
X	switch (c) {
X	case '0': case '1': case '2': case '3': case '4':
X	case '5': case '6': case '7': case '8': case '9':
X		p = argv[optind - 1];
X		if (p[0] == '-' && p[1] == ch && !p[2])
X			length = atoi(++p);
X		else
X			length = atoi(argv[optind] + 1);
X		break;
X	}
X}
X.cs R
SHAR_EOF
chmod 444 '/usr/src/man/man3/getopt.3'
fi
if test -f '/usr/src/man/man3/getsubopt.3'
then
	echo shar: "will not over-write existing file '/usr/src/man/man3/getsubopt.3'"
else
sed 's/^X//' << \SHAR_EOF > '/usr/src/man/man3/getsubopt.3'
X.\" Copyright (c) 1990, 1991, 1993
X.\"	The Regents of the University of California.  All rights reserved.
X.\"
X.\" Redistribution and use in source and binary forms, with or without
X.\" modification, are permitted provided that the following conditions
X.\" are met:
X.\" 1. Redistributions of source code must retain the above copyright
X.\"    notice, this list of conditions and the following disclaimer.
X.\" 2. Redistributions in binary form must reproduce the above copyright
X.\"    notice, this list of conditions and the following disclaimer in the
X.\"    documentation and/or other materials provided with the distribution.
X.\" 3. All advertising materials mentioning features or use of this software
X.\"    must display the following acknowledgement:
X.\"	This product includes software developed by the University of
X.\"	California, Berkeley and its contributors.
X.\" 4. Neither the name of the University nor the names of its contributors
X.\"    may be used to endorse or promote products derived from this software
X.\"    without specific prior written permission.
X.\"
X.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
X.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
X.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
X.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
X.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
X.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
X.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
X.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
X.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
X.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
X.\" SUCH DAMAGE.
X.\"
X.\"     @(#)getsubopt.3	8.1.1 (2.11BSD) 1996/1/12
X.\"
X.TH GETSUBOPT 3 "January 12, 1996"
X.UC 7
X.SH NAME
Xgetsubopt \- get sub options from an argument
X.SH SYNOPSIS
X.ft B
X#include <stdlib.h>
X.sp
Xextern char *suboptarg
X.sp
Xint
X.br
Xgetsubopt(optionp, tokens, valuep)
X.br
Xchar **optionp;
X.br
Xchar **tokens;
X.br
Xchar **valuep;
X.br
X.ft
X.SH DESCRIPTION
XThe
X.BR getsubopt ()
Xfunction
Xparses a string containing tokens delimited by one or more tab, space or
Xcomma
X(`,')
Xcharacters.
XIt is intended for use in parsing groups of option arguments provided
Xas part of a utility command line.
X.PP
XThe argument
X.I optionp
Xis a pointer to a pointer to the string.
XThe argument
X.I tokens
Xis a pointer to a
X\fBNULL\fP-terminated
Xarray of pointers to strings.
X.PP
XThe
X.BR getsubopt ()
Xfunction
Xreturns the zero-based offset of the pointer in the
X.I tokens
Xarray referencing a string which matches the first token
Xin the string, or, \-1 if the string contains no tokens or
X.I tokens
Xdoes not contain a matching string.
X.PP
XIf the token is of the form ``name=value'', the location referenced by
X.I valuep
Xwill be set to point to the start of the ``value'' portion of the token.
X.PP
XOn return from
X.BR getsubopt (),
X.I optionp
Xwill be set to point to the start of the next token in the string,
Xor the null at the end of the string if no more tokens are present.
XThe external variable
X.I suboptarg
Xwill be set to point to the start of the current token, or
X.B NULL
Xif no
Xtokens were present.
XThe argument
X.I valuep
Xwill be set to point to the ``value'' portion of the token, or
X.B NULL
Xif no ``value'' portion was present.
X.SH EXAMPLE
X.nf
X.cs R 24
Xchar *tokens[] = {
X	#define	ONE	0
X		"one",
X	#define	TWO	1
X		"two",
X	NULL
X};
X
X\&...
X
Xextern char *optarg, *suboptarg;
Xchar *options, *value;
X
Xwhile ((ch = getopt(argc, argv, "ab:")) != \-1) {
X	switch(ch) {
X	case 'a':
X		/* process ``a'' option */
X		break;
X	case 'b':
X		options = optarg;
X		while (*options) {
X			switch(getsubopt(&options, tokens, &value)) {
X			case ONE:
X				/* process ``one'' sub option */
X				break;
X			case TWO:
X				/* process ``two'' sub option */
X				if (!value)
X					error("no value for two");
X				i = atoi(value);
X				break;
X			case \-1:
X				if (suboptarg)
X					error("illegal sub option %s",
X					  suboptarg);
X				else
X					error("missing sub option");
X				break;
X		}
X		break;
X	}
X.br
X.cs R
X.fi
X.SH SEE ALSO
Xgetopt(3), strsep(3)
X.SH HISTORY
XThe
X.BR getsubopt ()
Xfunction first appeared in 4.4BSD.
SHAR_EOF
chmod 444 '/usr/src/man/man3/getsubopt.3'
fi
if test -f '/usr/src/man/man3/strcspn.3'
then
	echo shar: "will not over-write existing file '/usr/src/man/man3/strcspn.3'"
else
sed 's/^X//' << \SHAR_EOF > '/usr/src/man/man3/strcspn.3'
X.\" Copyright (c) 1990, 1991, 1993
X.\"	The Regents of the University of California.  All rights reserved.
X.\"
X.\" This code is derived from software contributed to Berkeley by
X.\" Chris Torek and the American National Standards Committee X3,
X.\" on Information Processing Systems.
X.\"
X.\" Redistribution and use in source and binary forms, with or without
X.\" modification, are permitted provided that the following conditions
X.\" are met:
X.\" 1. Redistributions of source code must retain the above copyright
X.\"    notice, this list of conditions and the following disclaimer.
X.\" 2. Redistributions in binary form must reproduce the above copyright
X.\"    notice, this list of conditions and the following disclaimer in the
X.\"    documentation and/or other materials provided with the distribution.
X.\" 3. All advertising materials mentioning features or use of this software
X.\"    must display the following acknowledgement:
X.\"	This product includes software developed by the University of
X.\"	California, Berkeley and its contributors.
X.\" 4. Neither the name of the University nor the names of its contributors
X.\"    may be used to endorse or promote products derived from this software
X.\"    without specific prior written permission.
X.\"
X.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
X.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
X.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
X.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
X.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
X.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
X.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
X.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
X.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
X.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
X.\" SUCH DAMAGE.
X.\"
X.\"     @(#)strcspn.3	8.1.1 (2.11BSD) 1996/1/12
X.\"
X.TH STRCSPN 3 "January 12, 1996"
X.UC 7
X.SH NAME
X\fBstrcspn\fP \- span the complement of a string
X.SH SYNOPSIS
X.B #include <string.h>
X.sp
X.B size_t
X.br
X\fBstrcspn\fP(s, charset)
X.br
X.I char *s;
X.br
X.I char *charset;
X.SH DESCRIPTION
XThe
X.BR strcspn ()
Xfunction
Xspans the initial part of the null-terminated string
X.I s
Xas long as the characters from
X.I s
Xdo not occur in string
X.I charset
X(it
Xspans the
X.I complement
Xof
X.I charset ) .
X.SH RETURN VALUES
XThe
X.BR strcspn ()
Xfunction
Xreturns the number of characters spanned.
X.SH SEE ALSO
Xindex(3), memchr(3), rindex(3), strchr(3),
Xstrpbrk(3),
Xstrrchr(3),
Xstrsep(3),
Xstrspn(3),
Xstrstr(3),
Xstrtok(3)
X.SH STANDARDS
XThe
X.BR strcspn ()
Xfunction
Xconforms to
XANSI C X3.159-1989 (``ANSI C'').
SHAR_EOF
chmod 444 '/usr/src/man/man3/strcspn.3'
fi
if test -f '/usr/src/man/man3/strpbrk.3'
then
	echo shar: "will not over-write existing file '/usr/src/man/man3/strpbrk.3'"
else
sed 's/^X//' << \SHAR_EOF > '/usr/src/man/man3/strpbrk.3'
X.\" Copyright (c) 1990, 1991, 1993
X.\"	The Regents of the University of California.  All rights reserved.
X.\"
X.\" This code is derived from software contributed to Berkeley by
X.\" Chris Torek and the American National Standards Committee X3,
X.\" on Information Processing Systems.
X.\"
X.\" Redistribution and use in source and binary forms, with or without
X.\" modification, are permitted provided that the following conditions
X.\" are met:
X.\" 1. Redistributions of source code must retain the above copyright
X.\"    notice, this list of conditions and the following disclaimer.
X.\" 2. Redistributions in binary form must reproduce the above copyright
X.\"    notice, this list of conditions and the following disclaimer in the
X.\"    documentation and/or other materials provided with the distribution.
X.\" 3. All advertising materials mentioning features or use of this software
X.\"    must display the following acknowledgement:
X.\"	This product includes software developed by the University of
X.\"	California, Berkeley and its contributors.
X.\" 4. Neither the name of the University nor the names of its contributors
X.\"    may be used to endorse or promote products derived from this software
X.\"    without specific prior written permission.
X.\"
X.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
X.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
X.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
X.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
X.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
X.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
X.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
X.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
X.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
X.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
X.\" SUCH DAMAGE.
X.\"
X.\"     @(#)strpbrk.3	8.1.1 (2.11BSD) 1996/1/12
X.\"
X.TH STRPBRK 3 "January 12, 1996"
X.UC 7
X.SH NAME
X\fBstrpbrk\fP \- locate multiple characters in string
X.SH SYNOPSIS
X.B #include <string.h>
X.sp
X.B char *
X.br
X\fBstrpbrk\fP(s, charset)
X.br
X.I char *s;
X.br
X.I char *charset;
X.SH DESCRIPTION
XThe
X.BR strpbrk ()
Xfunction
Xlocates in the null-terminated string
X.I s
Xthe first occurrence of any character in the string
X.I charset
Xand returns a pointer to this character.
XIf no characters from
X.I charset
Xoccur anywhere in
X.I s
X.BR strpbrk ()
Xreturns NULL.
X.SH SEE ALSO
Xindex(3),
Xmemchr(3),
Xrindex(3),
Xstrchr(3),
Xstrcspn(3),
Xstrrchr(3),
Xstrsep(3),
Xstrspn(3),
Xstrstr(3),
Xstrtok(3)
X.SH STANDARDS
XThe
X.BR strpbrk ()
Xfunction
Xconforms to
XANSI C X3.159-1989 )``ANSI C'').
SHAR_EOF
chmod 444 '/usr/src/man/man3/strpbrk.3'
fi
if test -f '/usr/src/man/man3/strsep.3'
then
	echo shar: "will not over-write existing file '/usr/src/man/man3/strsep.3'"
else
sed 's/^X//' << \SHAR_EOF > '/usr/src/man/man3/strsep.3'
X.\" Copyright (c) 1990, 1991, 1993
X.\"	The Regents of the University of California.  All rights reserved.
X.\"
X.\" This code is derived from software contributed to Berkeley by
X.\" Chris Torek.
X.\"
X.\" Redistribution and use in source and binary forms, with or without
X.\" modification, are permitted provided that the following conditions
X.\" are met:
X.\" 1. Redistributions of source code must retain the above copyright
X.\"    notice, this list of conditions and the following disclaimer.
X.\" 2. Redistributions in binary form must reproduce the above copyright
X.\"    notice, this list of conditions and the following disclaimer in the
X.\"    documentation and/or other materials provided with the distribution.
X.\" 3. All advertising materials mentioning features or use of this software
X.\"    must display the following acknowledgement:
X.\"	This product includes software developed by the University of
X.\"	California, Berkeley and its contributors.
X.\" 4. Neither the name of the University nor the names of its contributors
X.\"    may be used to endorse or promote products derived from this software
X.\"    without specific prior written permission.
X.\"
X.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
X.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
X.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
X.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
X.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
X.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
X.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
X.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
X.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
X.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
X.\" SUCH DAMAGE.
X.\"
X.\"	@(#)strsep.3	8.1.1 (2.11BSD) 1996/1/12
X.\"
X.TH STRSEP 3 "January 12, 1996"
X.UC 7
X.SH NAME
X\fBstrsep\fP \- separate strings
X.SH SYNOPSIS
X.B #include <string.h>
X.sp
X.B char *
X.br
X\fBstrsep\fP(stringp, delim)
X.br
X.I char **stringp;
X.br
X.I char *delim;
X.SH DESCRIPTION
XThe
X.BR strsep ()
Xfunction locates, in the string referenced by
X.I *stringp ,
Xthe first occurrence of any character in the string
X.I delim
X(or the terminating
X`\e0'
Xcharacter) and replaces it with a
X`\e0'.
XThe location of the next character after the delimiter character
X(or NULL, if the end of the string was reached) is stored in
X.I *stringp .
XThe original value of
X.I *stringp
Xis returned.
X.PP
XAn ``empty'' field, i.e. one caused by two adjacent delimiter characters,
Xcan be detected by comparing the location referenced by the pointer returned
Xin
X.I *stringp
Xto
X`\e0'.
X.PP
XIf
X.I *stringp
Xis initially
X.BR NULL ,
X.BR strsep ()
Xreturns
X.BR NULL .
X.SH EXAMPLES
XThe following uses
X.BR strsep ()
Xto parse a string, containing tokens delimited by white space, into an
Xargument vector:
X.sp
X.nf
X.cs R 24
Xchar **ap, *argv[10], *inputstring;
X
Xfor (ap = argv; (*ap = strsep(&inputstring, " \et")) != NULL;)
X	if (**ap != '\e0')
X		++ap;
X.br
X.cs R
X.fi
X.SH HISTORY
XThe
X.BR strsep ()
Xfunction
Xis intended as a replacement for the
X.BR strtok ()
Xfunction.
XWhile the
X.BR strtok ()
Xfunction should be preferred for portability reasons (it conforms to
XANSI C X3.159-1989 (``ANSI C''))
Xit is unable to handle empty fields, i.e. detect fields delimited by
Xtwo adjacent delimiter characters, or to be used for more than a single
Xstring at a time.
XThe
X.BR strsep ()
Xfunction first appeared in 4.4BSD.
SHAR_EOF
chmod 444 '/usr/src/man/man3/strsep.3'
fi
if test -f '/usr/src/man/man3/strspn.3'
then
	echo shar: "will not over-write existing file '/usr/src/man/man3/strspn.3'"
else
sed 's/^X//' << \SHAR_EOF > '/usr/src/man/man3/strspn.3'
X.\" Copyright (c) 1990, 1991, 1993
X.\"	The Regents of the University of California.  All rights reserved.
X.\"
X.\" This code is derived from software contributed to Berkeley by
X.\" Chris Torek and the American National Standards Committee X3,
X.\" on Information Processing Systems.
X.\"
X.\" Redistribution and use in source and binary forms, with or without
X.\" modification, are permitted provided that the following conditions
X.\" are met:
X.\" 1. Redistributions of source code must retain the above copyright
X.\"    notice, this list of conditions and the following disclaimer.
X.\" 2. Redistributions in binary form must reproduce the above copyright
X.\"    notice, this list of conditions and the following disclaimer in the
X.\"    documentation and/or other materials provided with the distribution.
X.\" 3. All advertising materials mentioning features or use of this software
X.\"    must display the following acknowledgement:
X.\"	This product includes software developed by the University of
X.\"	California, Berkeley and its contributors.
X.\" 4. Neither the name of the University nor the names of its contributors
X.\"    may be used to endorse or promote products derived from this software
X.\"    without specific prior written permission.
X.\"
X.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
X.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
X.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
X.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
X.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
X.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
X.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
X.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
X.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
X.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
X.\" SUCH DAMAGE.
X.\"
X.\"     @(#)strspn.3	8.1.1 (2.11BSD) 1996/1/12
X.\"
X.TH STRSPN 3 "January 12, 1996"
X.UC 7
X.SH NAME
X\fBstrspn\fP \- span a string
X.SH SYNOPSIS
X.B #include <string.h>
X.sp
X.B size_t
X.br
X\fBstrspn\fP(s, charset)
X.br
X.I char *s;
X.br
X.I char *charset;
X.SH DESCRIPTION
XThe
X.BR strcspn ()
Xfunction
Xspans the initial part of the null-terminated string
X.I s
Xas long as the characters from
X.I s
Xoccur in string
X.I charset .
X.SH RETURN VALUES
XThe
X.BR strspn ()
Xfunction
Xreturns the number of characters spanned.
X.SH SEE ALSO
Xindex(3),
Xmemchr(3),
Xrindex(3),
Xstrchr(3),
Xstrcspn(3),
Xstrpbrk(3),
Xstrrchr(3),
Xstrsep(3),
Xstrstr(3),
Xstrtok(3)
X.SH STANDARDS
XThe
X.BR strspn ()
Xfunction
Xconforms to
XANSI C X3.159-9189 (``ANSI C'').
SHAR_EOF
chmod 444 '/usr/src/man/man3/strspn.3'
fi
if test -f '/usr/src/man/man3/strstr.3'
then
	echo shar: "will not over-write existing file '/usr/src/man/man3/strstr.3'"
else
sed 's/^X//' << \SHAR_EOF > '/usr/src/man/man3/strstr.3'
X.\" Copyright (c) 1990, 1991, 1993
X.\"	The Regents of the University of California.  All rights reserved.
X.\"
X.\" This code is derived from software contributed to Berkeley by
X.\" Chris Torek and the American National Standards Committee X3,
X.\" on Information Processing Systems.
X.\"
X.\" Redistribution and use in source and binary forms, with or without
X.\" modification, are permitted provided that the following conditions
X.\" are met:
X.\" 1. Redistributions of source code must retain the above copyright
X.\"    notice, this list of conditions and the following disclaimer.
X.\" 2. Redistributions in binary form must reproduce the above copyright
X.\"    notice, this list of conditions and the following disclaimer in the
X.\"    documentation and/or other materials provided with the distribution.
X.\" 3. All advertising materials mentioning features or use of this software
X.\"    must display the following acknowledgement:
X.\"	This product includes software developed by the University of
X.\"	California, Berkeley and its contributors.
X.\" 4. Neither the name of the University nor the names of its contributors
X.\"    may be used to endorse or promote products derived from this software
X.\"    without specific prior written permission.
X.\"
X.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
X.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
X.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
X.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
X.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
X.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
X.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
X.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
X.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
X.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
X.\" SUCH DAMAGE.
X.\"
X.\"     @(#)strstr.3	8.1.1 (2.11BSD) 1996/1/15
X.\"
X.TH STRSTR 3 "January 15, 1996"
X.UC 7
X.SH NAME
X\fBstrstr\fP \- locate a substring in a string
X.SH SYNOPSIS
X.B #include <string.h>
X.sp
X.B char *
X.br
X.B strstr(big, little)
X.br
X.I  char *big, *little;
X.br
X.SH DESCRIPTION
XThe
X.BR strstr ()
Xfunction
Xlocates the first occurrence of the null-terminated string
X.I little
Xin the null-terminated string
X.IR big .
XIf
X.I little
Xis the empty string,
X.BR strstr ()
Xreturns
X.IR big ;
Xif
X.I little
Xoccurs nowhere in
X.IR big ,
X.BR strstr ()
Xreturns NULL;
Xotherwise
X.BR strstr ()
Xreturns a pointer to the first character of the first occurrence of
X.IR little .
X.SH SEE ALSO
Xindex(3),
Xmemchr(3),
Xrindex(3),
Xstrchr(3),
Xstrcspn(3),
Xstrpbrk(3),
Xstrrchr(3),
Xstrsep(3),
Xstrspn(3),
Xstrtok(3)
X.SH STANDARDS
XThe
X.BR strstr ()
Xfunction
Xconforms to
XANSI C X3/159-1989 (``ANSI C'').
SHAR_EOF
chmod 444 '/usr/src/man/man3/strstr.3'
fi
if test -f '/usr/src/man/man3/strtok.3'
then
	echo shar: "will not over-write existing file '/usr/src/man/man3/strtok.3'"
else
sed 's/^X//' << \SHAR_EOF > '/usr/src/man/man3/strtok.3'
X.\" Copyright (c) 1988, 1991, 1993
X.\"	The Regents of the University of California.  All rights reserved.
X.\"
X.\" This code is derived from software contributed to Berkeley by
X.\" the American National Standards Committee X3, on Information
X.\" Processing Systems.
X.\"
X.\" Redistribution and use in source and binary forms, with or without
X.\" modification, are permitted provided that the following conditions
X.\" are met:
X.\" 1. Redistributions of source code must retain the above copyright
X.\"    notice, this list of conditions and the following disclaimer.
X.\" 2. Redistributions in binary form must reproduce the above copyright
X.\"    notice, this list of conditions and the following disclaimer in the
X.\"    documentation and/or other materials provided with the distribution.
X.\" 3. All advertising materials mentioning features or use of this software
X.\"    must display the following acknowledgement:
X.\"	This product includes software developed by the University of
X.\"	California, Berkeley and its contributors.
X.\" 4. Neither the name of the University nor the names of its contributors
X.\"    may be used to endorse or promote products derived from this software
X.\"    without specific prior written permission.
X.\"
X.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
X.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
X.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
X.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
X.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
X.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
X.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
X.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
X.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
X.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
X.\" SUCH DAMAGE.
X.\"
X.\"     @(#)strtok.3	8.2.1 (2.11BSD) 1996/1/12
X.\"
X.TH STRTOK 3 "January 12, 1996"
X.UC 7
X.SH NAME
X\fBstrtok\fP \- string tokens
X.SH SYNOPSIS
X.B #include <string.h>
X.sp
X.B char *
X.br
X\fBstrtok\fP(str, sep)
X.br
X.I char *str;
X.br
X.I char *sep;
X.SH DESCRIPTION
X.B This interface is obsoleted by strsep(3).
X.PP
XThe
X.BR strtok ()
Xfunction
Xis used to isolate sequential tokens in a null-terminated string,
X.I str .
XThese tokens are separated in the string by at least one of the
Xcharacters in
X.I sep .
XThe first time that
X.BR strtok ()
Xis called,
X.I str
Xshould be specified; subsequent calls, wishing to obtain further tokens
Xfrom the same string, should pass a null pointer instead.
XThe separator string,
X.I sep ,
Xmust be supplied each time, and may change between calls.
X.PP
XThe
X.BR strtok ()
Xfunction
Xreturns a pointer to the beginning of each subsequent token in the string,
Xafter replacing the token itself with a
X.B NUL
Xcharacter.
XWhen no more tokens remain, a null pointer is returned.
X.SH SEE ALSO
Xindex(3),
Xmemchr(3),
Xrindex(3),
Xstrchr(3),
Xstrcspn(3),
Xstrpbrk(3),
Xstrrchr(3),
Xstrsep(3),
Xstrspn(3),
Xstrstr(3
X.SH STANDARDS
XThe
X.BR strtok ()
Xfunction
Xconforms to
XANSI C X3.159-1989 (``ANSI C'').
X.SH BUGS
XThere is no way to get tokens from multiple strings simultaneously.
X.PP
XThe System V
X.BR strtok (),
Xif handed a string containing only delimiter characters,
Xwill not alter the next starting point, so that a call to
X.BR strtok ()
Xwith a different (or empty) delimiter string
Xmay return a
Xnon-\fBNULL\fP
Xvalue.
XSince this implementation always alters the next starting point,
Xsuch a sequence of calls would always return
X.BR NULL .
SHAR_EOF
chmod 444 '/usr/src/man/man3/strtok.3'
fi
if test -f '/usr/src/man/man3/strtol.3'
then
	echo shar: "will not over-write existing file '/usr/src/man/man3/strtol.3'"
else
sed 's/^X//' << \SHAR_EOF > '/usr/src/man/man3/strtol.3'
X.\" Copyright (c) 1990, 1991, 1993
X.\"	The Regents of the University of California.  All rights reserved.
X.\"
X.\" This code is derived from software contributed to Berkeley by
X.\" Chris Torek and the American National Standards Committee X3,
X.\" on Information Processing Systems.
X.\"
X.\" Redistribution and use in source and binary forms, with or without
X.\" modification, are permitted provided that the following conditions
X.\" are met:
X.\" 1. Redistributions of source code must retain the above copyright
X.\"    notice, this list of conditions and the following disclaimer.
X.\" 2. Redistributions in binary form must reproduce the above copyright
X.\"    notice, this list of conditions and the following disclaimer in the
X.\"    documentation and/or other materials provided with the distribution.
X.\" 3. All advertising materials mentioning features or use of this software
X.\"    must display the following acknowledgement:
X.\"	This product includes software developed by the University of
X.\"	California, Berkeley and its contributors.
X.\" 4. Neither the name of the University nor the names of its contributors
X.\"    may be used to endorse or promote products derived from this software
X.\"    without specific prior written permission.
X.\"
X.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
X.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
X.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
X.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
X.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
X.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
X.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
X.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
X.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
X.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
X.\" SUCH DAMAGE.
X.\"
X.\"     @(#)strtol.3	8.1.1 (2.11BSD) 1996/1/12
X.\"
X.TH STRTOL 3 "January 12, 1996"
X.UC 7
X.SH NAME
X\fBstrtol\fP \- convert string value to a long
X.SH SYNOPSIS
X.B #include <stdlib.h>
X.br
X.B #include <limits.h>
X.sp
X.B long
X.br
X\fBstrtol\fP(nptr, endptr, base)
X.br
X.I char *nptr;
X.br
X.I char **endptr;
X.br
X.I int base;
X.SH DESCRIPTION
XThe
X.BR strtol ()
Xfunction
Xconverts the string in
X.I nptr
Xto a
X.I long
Xvalue.
XThe conversion is done according to the given
X.IR base ,
Xwhich must be between 2 and 36 inclusive,
Xor be the special value 0.
X.PP
XThe string may begin with an arbitrary amount of white space
X(as determined by
Xisspace(3))
Xfollowed by a single optional
X`+'
Xor
X`\-'
Xsign.
XIf
X.I base
Xis zero or 16,
Xthe string may then include a
X`0x'
Xprefix,
Xand the number will be read in base 16; otherwise, a zero
X.I base
Xis taken as 10 (decimal) unless the next character is
X`0',
Xin which case it is taken as 8 (octal).
X.PP
XThe remainder of the string is converted to a
X.I long
Xvalue in the obvious manner,
Xstopping at the first character which is not a valid digit
Xin the given base.
X(In bases above 10, the letter
X`A'
Xin either upper or lower case
Xrepresents 10,
X`B'
Xrepresents 11, and so forth, with
X`Z'
Xrepresenting 35.)
X.PP
XIf
X.I endptr
Xis non nil,
X.BR strtol ()
Xstores the address of the first invalid character in
X.I *endptr .
XIf there were no digits at all, however,
X.BR strtol ()
Xstores the original value of
X.I nptr
Xin
X.IR *endptr .
X(Thus, if
X.I *nptr
Xis not
X`\e0'
Xbut
X.I **endptr
Xis
X`\e0'
Xon return, the entire string was valid.)
X.SH RETURN VALUES
XThe
X.BR strtol ()
Xfunction
Xreturns the result of the conversion,
Xunless the value would underflow or overflow.
XIf an underflow occurs,
X.BR strtol ()
Xreturns
X.BR LONG_MIN .
XIf an overflow occurs,
X.BR strtol ()
Xreturns
X.BR LONG_MAX .
XIn both cases,
X.B errno
Xis set to
X.B ERANGE .
X.SH ERRORS
X.TP 15
X[ERANGE]
XThe given string was out of range; the value converted has been clamped.
X.SH SEE ALSO
Xatof(3),
Xatoi(3),
Xatol(3),
Xstrtoul(3)
X.SH STANDARDS
XThe
X.BR strtol ()
Xfunction
Xconforms to
XANSI C X3.159-1989 (``ANSI C'').
X.SH BUGS
XIgnores the current locale.
SHAR_EOF
chmod 444 '/usr/src/man/man3/strtol.3'
fi
if test -f '/usr/src/man/man3/strtoul.3'
then
	echo shar: "will not over-write existing file '/usr/src/man/man3/strtoul.3'"
else
sed 's/^X//' << \SHAR_EOF > '/usr/src/man/man3/strtoul.3'
X.\" Copyright (c) 1990, 1991, 1993
X.\"	The Regents of the University of California.  All rights reserved.
X.\"
X.\" This code is derived from software contributed to Berkeley by
X.\" Chris Torek and the American National Standards Committee X3,
X.\" on Information Processing Systems.
X.\"
X.\" Redistribution and use in source and binary forms, with or without
X.\" modification, are permitted provided that the following conditions
X.\" are met:
X.\" 1. Redistributions of source code must retain the above copyright
X.\"    notice, this list of conditions and the following disclaimer.
X.\" 2. Redistributions in binary form must reproduce the above copyright
X.\"    notice, this list of conditions and the following disclaimer in the
X.\"    documentation and/or other materials provided with the distribution.
X.\" 3. All advertising materials mentioning features or use of this software
X.\"    must display the following acknowledgement:
X.\"	This product includes software developed by the University of
X.\"	California, Berkeley and its contributors.
X.\" 4. Neither the name of the University nor the names of its contributors
X.\"    may be used to endorse or promote products derived from this software
X.\"    without specific prior written permission.
X.\"
X.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
X.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
X.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
X.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
X.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
X.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
X.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
X.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
X.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
X.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
X.\" SUCH DAMAGE.
X.\"
X.\"     @(#)strtoul.3	8.1.1 (2.11BSD) 1996/1/12
X.\"
X.TH STRTOUL 3 "January 12, 1996"
X.UC 7
X.SH NAME
X\fBstrtoul\fP \- convert a string to an unsigned long
X.SH SYNOPSIS
X.B #include <stdlib.h>
X.br
X.B #include <limits.h>
X.sp
X.B unsigned long
X.br
X\fBstrtoul\fP(nptr, endptr, base)
X.br
X.I char *nptr;
X.br
X.I char **endptr;
X.br
X.I int base;
X.SH DESCRIPTION
XThe
X.BR strtoul ()
Xfunction
Xconverts the string in
X.I nptr
Xto an
X.I unsigned long
Xvalue.
XThe conversion is done according to the given
X.IR base ,
Xwhich must be between 2 and 36 inclusive,
Xor be the special value 0.
X.PP
XThe string may begin with an arbitrary amount of white space
X(as determined by
Xisspace(3))
Xfollowed by a single optional
X`+'
Xor
X`\-'
Xsign.
XIf
X.I base
Xis zero or 16,
Xthe string may then include a
X`0x'
Xprefix,
Xand the number will be read in base 16; otherwise, a zero
X.I base
Xis taken as 10 (decimal) unless the next character is
X`0',
Xin which case it is taken as 8 (octal).
X.PP
XThe remainder of the string is converted to an
X.I unsigned long
Xvalue in the obvious manner,
Xstopping at the end of the string
Xor at the first character that does not produce a valid digit
Xin the given base.
X(In bases above 10, the letter
X`A'
Xin either upper or lower case
Xrepresents 10,
X`B'
Xrepresents 11, and so forth, with
X`Z'
Xrepresenting 35.)
X.PP
XIf
X.I endptr
Xis non nil,
X.BR strtoul ()
Xstores the address of the first invalid character in
X.I *endptr .
XIf there were no digits at all, however,
X.BR strtoul ()
Xstores the original value of
X.I nptr
Xin
X.I *endptr .
X(Thus, if
X.I *nptr
Xis not
X`\e0'
Xbut
X.I **endptr
Xis
X`\e0'
Xon return, the entire string was valid.)
X.SH RETURN VALUES
XThe
X.BR strtoul ()
Xfunction
Xreturns either the result of the conversion
Xor, if there was a leading minus sign,
Xthe negation of the result of the conversion,
Xunless the original (non-negated) value would overflow;
Xin the latter case,
X.BR strtoul ()
Xreturns
X.B ULONG_MAX
Xand sets the global variable
X.B errno
Xto
X.B ERANGE .
X.SH ERRORS
X.TP 15
X[ERANGE]
XThe given string was out of range; the value converted has been clamped.
X.SH SEE ALSO
Xstrtol(3)
X.SH STANDARDS
XThe
X.BR strtoul ()
Xfunction
Xconforms to
XANSI C X3.159-1989 (``ANSI C'').
X.SH BUGS
XIgnores the current locale.
SHAR_EOF
chmod 444 '/usr/src/man/man3/strtoul.3'
fi
if test -f '/usr/src/man/man5/fstab.5'
then
	echo shar: "will not over-write existing file '/usr/src/man/man5/fstab.5'"
else
sed 's/^X//' << \SHAR_EOF > '/usr/src/man/man5/fstab.5'
X.\" Copyright (c) 1980, 1989, 1991, 1993
X.\"	The Regents of the University of California.  All rights reserved.
X.\"
X.\" Redistribution and use in source and binary forms, with or without
X.\" modification, are permitted provided that the following conditions
X.\" are met:
X.\" 1. Redistributions of source code must retain the above copyright
X.\"    notice, this list of conditions and the following disclaimer.
X.\" 2. Redistributions in binary form must reproduce the above copyright
X.\"    notice, this list of conditions and the following disclaimer in the
X.\"    documentation and/or other materials provided with the distribution.
X.\" 3. All advertising materials mentioning features or use of this software
X.\"    must display the following acknowledgement:
X.\"	This product includes software developed by the University of
X.\"	California, Berkeley and its contributors.
X.\" 4. Neither the name of the University nor the names of its contributors
X.\"    may be used to endorse or promote products derived from this software
X.\"    without specific prior written permission.
X.\"
X.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
X.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
X.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
X.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
X.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
X.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
X.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
X.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
X.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
X.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
X.\" SUCH DAMAGE.
X.\"
X.\"     @(#)fstab.5	8.1.1 (2.11BSD) 1996/1/15
X.\"
X.TH FSTAB 5 "January 15, 1996"
X.UC 7
X.SH NAME
X\fBfstab\fP \- static information about the filesystems
X.SH SYNOPSIS
X.B #include <fstab.h>
X.SH DESCRIPTION
XThe file
X.B fstab
Xcontains descriptive information about the various file
Xsystems.
X.B fstab
Xis only read by programs, and not written;
Xit is the duty of the system administrator to properly create 
Xand maintain this file.
XEach filesystem is described on a separate line;
Xfields on each line are separated by tabs or spaces.
XThe order of records in
X.B fstab
Xis important because
Xfsck(8),
Xmount(8),
Xand
Xumount(8)
Xsequentially iterate through
X.B fstab
Xdoing their thing.
X.PP
XThe first field,
X.IR fs_spec ,
Xdescribes the block special device or
Xremote filesystem to be mounted.
XFor filesystems of type
X.IR ufs ,
Xthe special file name is the block special file name, 
Xand not the character special file name.
XIf a program needs the character special file name,
Xthe program must create it by appending a ``r'' after the
Xlast ``/'' in the special file name.
X.PP
XThe second field,
X.IR fs_file ,
Xdescribes the mount point for the filesystem.
XFor swap partitions, this field should be specified as ``none''.
X.PP
XThe third field,
X.IR fs_vfstype ,
Xdescribes the type of the filesystem.
XThe system currently supports only two types of filesystems:
X.TP 15
X.I ufs 
Xa local UNIX filesystem
X.TP 15
X.I swap 
Xa disk partition to be used for swapping
X.PP
XThe fourth field,
X.IR fs_mntops ,
Xdescribes the mount options associated with the filesystem.
XIt is formatted as a comma separated list of options.
XIt contains at least the type of mount (see
X.I fs_type
Xbelow) plus any additional options
Xappropriate to the filesystem type.
X.PP
XIf the option ``quotas'' is specified,
Xthe filesystem is automatically processed by the
Xquotacheck(8)
Xcommand, and user disk quotas are enabled with
Xquotaon(8).
XFilesystem quotas are maintained in the file named
X.I quotas
Xlocated at the root of the associated filesystem.  This restriction on
Xthe location of the quotas file is needlessly imposed by the kernel but
Xmay be lifted in the future.
XThus, if the user quota file for
X.I /tmp
Xis stored in
X.IR /var/quotas/tmp.user ,
Xthis location can be specified as:
X.sp
X.in +.75i
Xquotas=/var/quotas/tmp.user
X.br
X.in -0.75i
X.PP
XThe type of the mount is extracted from the
X.I fs_mntops
Xfield and stored separately in the
X.I fs_type
Xfield (it is not deleted from the
X.I fs_mntops
Xfield).
XIf
X.I fs_type
Xis ``rw'' or ``ro'' then the filesystem whose name is given in the
X.I fs_file
Xfield is normally mounted read-write or read-only on the
Xspecified special file.
XIf
X.I fs_type
Xis ``sw'' then the special file is made available as a piece of swap
Xspace by the
Xswapon(8)
Xcommand at the end of the system reboot procedure.
XThe fields other than
X.I fs_spec
Xand
X.I fs_type
Xare unused.
XIf
X.I fs_type
Xis specified as ``xx'' the entry is ignored.
XThis is useful to show disk partitions which are currently unused.
X.PP
XThe fifth field,
X.IR fs_freq ,
Xis used for these filesystems by the
Xdump(8)
Xcommand to determine which filesystems need to be dumped.
XIf the fifth field is not present, a value of zero is returned and
Xdump(8)
Xwill assume that the filesystem does not need to be dumped.
X.PP
XThe sixth field,
X.IR fs_passno ,
Xis used by the
Xfsck(8)
Xprogram to determine the order in which filesystem checks are done
Xat reboot time.
XThe root filesystem should be specified with a
X.I fs_passno
Xof 1, and other filesystems should have a 
X.I fs_passno
Xof 2.
XFilesystems within a drive will be checked sequentially,
Xbut filesystems on different drives will be checked at the
Xsame time to utilize parallelism available in the hardware.
XIf the sixth field is not present or zero,
Xa value of zero is returned and
Xfsck(8)
Xwill assume that the filesystem does not need to be checked.
X.br
X.nf
X.cs R 24
X
X#define	FSTAB_RW	"rw"	/* read-write device */
X#define	FSTAB_RO	"ro"	/* read-only device */
X#define	FSTAB_SW	"sw"	/* swap device */
X#define	FSTAB_XX	"xx"	/* ignore totally */
X
Xstruct fstab {
X	char	*fs_spec;	/* block special device name */
X	char	*fs_file;	/* filesystem path prefix */
X	char	*fs_vfstype;	/* type of filesystem */
X	char	*fs_mntops;	/* comma separated mount options */
X	char	*fs_type;	/* rw, ro, sw, or xx */
X	int	fs_freq;	/* dump frequency, in days */
X	int	fs_passno;	/* pass number on parallel dump */
X};
X.fi
X.cs R
X.PP
XThe proper way to read records from
X.I fstab
Xis to use the routines
Xgetfsent(3),
Xgetfsspec(3),
Xgetfstype(3),
Xand
Xgetfsfile(3).
X.SH FILES
X.TP 15
X.I /etc/fstab
XThe file
X.B fstab
Xresides in
X.IR /etc .
X.SH SEE ALSO
Xgetfsent(3)
X.SH HISTORY
XThe
X.B fstab
Xfile format appeared in
X4.0BSD.
SHAR_EOF
chmod 444 '/usr/src/man/man5/fstab.5'
fi
if test -f '/usr/src/man/man8/quotaon.8'
then
	echo shar: "will not over-write existing file '/usr/src/man/man8/quotaon.8'"
else
sed 's/^X//' << \SHAR_EOF > '/usr/src/man/man8/quotaon.8'
X.\" Copyright (c) 1983, 1990, 1991, 1993
X.\"	The Regents of the University of California.  All rights reserved.
X.\"
X.\" This code is derived from software contributed to Berkeley by
X.\" Robert Elz at The University of Melbourne.
X.\" Redistribution and use in source and binary forms, with or without
X.\" modification, are permitted provided that the following conditions
X.\" are met:
X.\" 1. Redistributions of source code must retain the above copyright
X.\"    notice, this list of conditions and the following disclaimer.
X.\" 2. Redistributions in binary form must reproduce the above copyright
X.\"    notice, this list of conditions and the following disclaimer in the
X.\"    documentation and/or other materials provided with the distribution.
X.\" 3. All advertising materials mentioning features or use of this software
X.\"    must display the following acknowledgement:
X.\"	This product includes software developed by the University of
X.\"	California, Berkeley and its contributors.
X.\" 4. Neither the name of the University nor the names of its contributors
X.\"    may be used to endorse or promote products derived from this software
X.\"    without specific prior written permission.
X.\"
X.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
X.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
X.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
X.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
X.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
X.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
X.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
X.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
X.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
X.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
X.\" SUCH DAMAGE.
X.\"
X.\"     @(#)quotaon.8	8.2.1 (2.11BSD) 1996/1/21
X.\"
X.TH QUOTAON 8 "January 21, 1996"
X.UC 5
X.SH NAME
X.BR quotaon ,
X.B quotaoff
X\- turn filesystem quotas on and off
X.SH SYNOPSIS
X\fBquotaon\fP [\fB\-v\fP] \fIfilesystem ...\fP
X.br
X\fBquotaon\fP [\fB\-v\fP] \fB\-a\fP
X.br
X\fBquotaoff\fP [\fB\-v\fP] \fIfilesystem ...\fP
X.br
X\fBquotaoff\fP [\fB\-v\fP] \fB\-a\fP
X.SH DESCRIPTION
X.B Quotaon
Xannounces to the system that disk quotas should be enabled on one or more
Xfilesystems.
X.B Quotaoff
Xannounces to the system that the specified
Xfilesystems should have any disk quotas
Xdiskquotas turned off.
XThe filesystems specified must have entries in
X.I /etc/fstab
Xand be mounted.
X.B Quotaon
Xexpects each filesystem to have a quota file named
X.I quotas
Xlocated at the root of the associated file system.
XThese defaults may be overridden in
X.IR /etc/fstab .
X.PP
XAvailable options:
X.sp
X.TP 15
X.B \-a
XIf the
X.B \-a
Xflag is supplied in place of any filesystem names,
X\fBquotaon\fP/\fBquotaoff\fP
Xwill enable/disable all the filesystems indicated in
X.I /etc/fstab
Xto be read-write with disk quotas.
X.TP 15
X.B \-v
XCauses
X.B quotaon
Xand
X.B quotaoff
Xto print a message for each filesystem where quotas are turned on or off.
X.SH FILES
X.TP 15
X.I quotas
Xat the filesystem root with user quotas
X.TP 15
X.I /etc/fstab
Xfilesystem table
X.SH SEE ALSO
Xquota(1),
Xsetquota(2),
Xfstab(5),
Xedquota(8),
Xquotacheck(8),
Xrepquota(8)
X.SH HISTORY
XThe
X.B quotaon
Xcommand appeared in 4.2BSD.
SHAR_EOF
chmod 644 '/usr/src/man/man8/quotaon.8'
fi
if test -f '/usr/src/sys/pdp/limits.h'
then
	echo shar: "will not over-write existing file '/usr/src/sys/pdp/limits.h'"
else
sed 's/^X//' << \SHAR_EOF > '/usr/src/sys/pdp/limits.h'
X/*
X * Copyright (c) 1988, 1993
X *	The Regents of the University of California.  All rights reserved.
X *
X * Redistribution and use in source and binary forms, with or without
X * modification, are permitted provided that the following conditions
X * are met:
X * 1. Redistributions of source code must retain the above copyright
X *    notice, this list of conditions and the following disclaimer.
X * 2. Redistributions in binary form must reproduce the above copyright
X *    notice, this list of conditions and the following disclaimer in the
X *    documentation and/or other materials provided with the distribution.
X * 3. All advertising materials mentioning features or use of this software
X *    must display the following acknowledgement:
X *	This product includes software developed by the University of
X *	California, Berkeley and its contributors.
X * 4. Neither the name of the University nor the names of its contributors
X *    may be used to endorse or promote products derived from this software
X *    without specific prior written permission.
X *
X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
X * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
X * SUCH DAMAGE.
X *
X *	@(#)limits.h	8.3.1 (2.11BSD) 1996/1/11
X */
X
X#define	CHAR_BIT	8		/* number of bits in a char */
X
X
X#define	CLK_TCK		60		/* ticks per second */
X
X/*
X * According to ANSI (section 2.2.4.2), the values below must be usable by
X * #if preprocessing directives.  Additionally, the expression must have the
X * same type as would an expression that is an object of the corresponding
X * type converted according to the integral promotions.  The subtraction for
X * INT_MIN and LONG_MIN is so the value is not unsigned; 2147483648 is an
X * unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2).
X * These numbers work for pcc as well.  The UINT_MAX and ULONG_MAX values
X * are written as hex so that GCC will be quiet about large integer constants.
X */
X#define	SCHAR_MAX	127		/* min value for a signed char */
X#define	SCHAR_MIN	(-128)		/* max value for a signed char */
X
X#define	UCHAR_MAX	255		/* max value for an unsigned char */
X#define	CHAR_MAX	127		/* max value for a char */
X#define	CHAR_MIN	(-128)		/* min value for a char */
X
X#define	USHRT_MAX	65535		/* max value for an unsigned short */
X#define	SHRT_MAX	32767		/* max value for a short */
X#define	SHRT_MIN	(-32768)	/* min value for a short */
X
X#define	UINT_MAX	0xffff		/* max value for an unsigned int */
X#define	INT_MAX		32767		/* max value for an int */
X#define	INT_MIN		(-32767-1)	/* min value for an int */
X
X#define	ULONG_MAX	0xffffffff	/* max value for an unsigned long */
X#define	LONG_MAX	2147483647L	/* max value for a long */
X#define	LONG_MIN	(-2147483647L-1L)	/* min value for a long */
X
X#define	SSIZE_MAX	INT_MAX		/* max value for a ssize_t */
X
X#define	SIZE_T_MAX	UINT_MAX	/* max value for a size_t */
SHAR_EOF
chmod 444 '/usr/src/sys/pdp/limits.h'
fi
exit 0
#	End of shell archive