get the usage statement right
[unix-history] / usr / src / sbin / mount_procfs / mount_procfs.c
CommitLineData
f7b3d535
JSP
1/*
2 * Copyright (c) 1990, 1992, 1993 Jan-Simon Pendry
3 * Copyright (c) 1992, 1993
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 *
86fb1f25 11 * @(#)mount_procfs.c 8.2 (Berkeley) %G%
f7b3d535
JSP
12 */
13
14#include <sys/param.h>
15#include <sys/mount.h>
16
17#include <errno.h>
18#include <unistd.h>
19#include <stdio.h>
20#include <stdlib.h>
21#include <string.h>
22
23void usage __P((void));
24
25int
26main(argc, argv)
27 int argc;
28 char *argv[];
29{
30 int ch, mntflags;
31
32 mntflags = 0;
33 while ((ch = getopt(argc, argv, "F:")) != EOF)
34 switch(ch) {
35 case 'F':
36 mntflags = atoi(optarg);
37 break;
38 case '?':
39 default:
40 usage();
41 }
42 argc -= optind;
43 argv += optind;
44
45 if (argc != 2)
46 usage();
47
48 if (mount(MOUNT_PROCFS, argv[1], mntflags, NULL)) {
86fb1f25 49 (void)fprintf(stderr, "mount_procfs: %s\n", strerror(errno));
f7b3d535
JSP
50 exit(1);
51 }
52 exit(0);
53}
54
55void
56usage()
57{
58 (void)fprintf(stderr,
59 "usage: mount_procfs [ -F fsoptions ] /proc mount_point\n");
60 exit(1);
61}