165611Spendry /*
265611Spendry  * Copyright (c) 1990, 1992, 1993 Jan-Simon Pendry
366476Sbostic  * Copyright (c) 1992, 1993, 1994
465611Spendry  *	The Regents of the University of California.  All rights reserved.
565611Spendry  *
665611Spendry  * This code is derived from software contributed to Berkeley by
765611Spendry  * Jan-Simon Pendry.
865611Spendry  *
965611Spendry  * %sccs.include.redist.c%
1065611Spendry  */
1165611Spendry 
1266476Sbostic #ifndef lint
1366476Sbostic char copyright[] =
1466476Sbostic "@(#) Copyright (c) 1992, 1993, 1994\n\
1566476Sbostic 	The Regents of the University of California.  All rights reserved.\n";
1666476Sbostic #endif /* not lint */
1766476Sbostic 
1866476Sbostic #ifndef lint
19*68903Smckusick static char sccsid[] = "@(#)mount_procfs.c	8.4 (Berkeley) 04/26/95";
2066476Sbostic #endif /* not lint */
2166476Sbostic 
2265611Spendry #include <sys/param.h>
2365611Spendry #include <sys/mount.h>
2465611Spendry 
2566476Sbostic #include <err.h>
2665611Spendry #include <unistd.h>
2765611Spendry #include <stdio.h>
2865611Spendry #include <stdlib.h>
2965611Spendry #include <string.h>
3065611Spendry 
3166476Sbostic #include "mntopts.h"
3265611Spendry 
3366476Sbostic struct mntopt mopts[] = {
3466476Sbostic 	MOPT_STDOPTS,
3566476Sbostic 	{ NULL }
3666476Sbostic };
3766476Sbostic 
3866476Sbostic void	usage __P((void));
3966476Sbostic 
4065611Spendry int
main(argc,argv)4165611Spendry main(argc, argv)
4265611Spendry 	int argc;
4365611Spendry 	char *argv[];
4465611Spendry {
4565611Spendry 	int ch, mntflags;
4665611Spendry 
4765611Spendry 	mntflags = 0;
4866476Sbostic 	while ((ch = getopt(argc, argv, "o:")) != EOF)
4966476Sbostic 		switch (ch) {
5066476Sbostic 		case 'o':
51*68903Smckusick 			getmntopts(optarg, mopts, &mntflags, 0);
5265611Spendry 			break;
5365611Spendry 		case '?':
5465611Spendry 		default:
5565611Spendry 			usage();
5665611Spendry 		}
5765611Spendry 	argc -= optind;
5865611Spendry 	argv += optind;
5965611Spendry 
6065611Spendry 	if (argc != 2)
6165611Spendry 		usage();
6265611Spendry 
63*68903Smckusick 	if (mount("procfs", argv[1], mntflags, NULL))
6466476Sbostic 		err(1, NULL);
6565611Spendry 	exit(0);
6665611Spendry }
6765611Spendry 
6865611Spendry void
usage()6965611Spendry usage()
7065611Spendry {
7165611Spendry 	(void)fprintf(stderr,
7266476Sbostic 		"usage: mount_procfs [-o options] /proc mount_point\n");
7365611Spendry 	exit(1);
7465611Spendry }
75