1 /*
2  * Copyright (c) 1990, 1992, 1993 Jan-Simon Pendry
3  * Copyright (c) 1992, 1993, 1994
4  *	The Regents of the University of California.  All rights reserved.
5  *
6  * This code is derived from software contributed to Berkeley by
7  * Jan-Simon Pendry.
8  *
9  * %sccs.include.redist.c%
10  */
11 
12 #ifndef lint
13 char copyright[] =
14 "@(#) Copyright (c) 1992, 1993, 1994\n\
15 	The Regents of the University of California.  All rights reserved.\n";
16 #endif /* not lint */
17 
18 #ifndef lint
19 static char sccsid[] = "@(#)mount_procfs.c	8.3 (Berkeley) 03/27/94";
20 #endif /* not lint */
21 
22 #include <sys/param.h>
23 #include <sys/mount.h>
24 
25 #include <err.h>
26 #include <unistd.h>
27 #include <stdio.h>
28 #include <stdlib.h>
29 #include <string.h>
30 
31 #include "mntopts.h"
32 
33 struct mntopt mopts[] = {
34 	MOPT_STDOPTS,
35 	{ NULL }
36 };
37 
38 void	usage __P((void));
39 
40 int
41 main(argc, argv)
42 	int argc;
43 	char *argv[];
44 {
45 	int ch, mntflags;
46 
47 	mntflags = 0;
48 	while ((ch = getopt(argc, argv, "o:")) != EOF)
49 		switch (ch) {
50 		case 'o':
51 			getmntopts(optarg, mopts, &mntflags);
52 			break;
53 		case '?':
54 		default:
55 			usage();
56 		}
57 	argc -= optind;
58 	argv += optind;
59 
60 	if (argc != 2)
61 		usage();
62 
63 	if (mount(MOUNT_PROCFS, argv[1], mntflags, NULL))
64 		err(1, NULL);
65 	exit(0);
66 }
67 
68 void
69 usage()
70 {
71 	(void)fprintf(stderr,
72 		"usage: mount_procfs [-o options] /proc mount_point\n");
73 	exit(1);
74 }
75