NetBSD/sbin/mount_isofs/mount_isofs.c

62 lines
1019 B
C
Raw Normal View History

1993-03-22 11:04:00 +03:00
#ifndef lint
static char rcsid[] = "$Id: mount_isofs.c,v 1.8 1993/10/20 19:53:36 cgd Exp $";
#endif /* not lint */
1993-03-22 11:04:00 +03:00
1993-03-21 12:45:37 +03:00
#include <stdio.h>
#include <sys/types.h>
1993-07-19 17:31:39 +04:00
#define ISOFS
1993-03-21 12:45:37 +03:00
#include <sys/mount.h>
void
usage ()
{
fprintf (stderr, "usage: mount_iso bdev dir\n");
exit (1);
}
int
main (argc, argv)
int argc;
char **argv;
{
char *dev;
char *dir;
struct iso_args args;
1993-03-21 12:45:37 +03:00
int c;
int opts = 0, mntflags = 0;
1993-03-21 12:45:37 +03:00
1993-07-19 17:31:39 +04:00
argc--;
argv++;
while (argc > 2) {
if (!strcmp("-F", argv[0])) {
argc--; argv++;
mntflags |= atoi(argv[0]);
1993-07-19 17:31:39 +04:00
argc--; argv++;
} else if (!strcmp(argv[0], "-norrip")) {
opts |= ISOFSMNT_NORRIP;
argc--; argv++;
} else if (!strcmp(argv[0], "-gen")) {
opts |= ISOFSMNT_GENS;
argc--; argv++;
} else if (!strcmp(argv[0], "-extattr")) {
opts |= ISOFSMNT_EXTATT;
argc--; argv++;
1993-07-19 17:31:39 +04:00
} else
usage();
1993-03-21 12:45:37 +03:00
}
1993-07-19 17:31:39 +04:00
dev = argv[0];
dir = argv[1];
1993-03-21 12:45:37 +03:00
args.fspec = dev;
args.flags = opts;
1993-03-21 12:45:37 +03:00
if (mount (MOUNT_ISOFS, dir, mntflags, &args) < 0) {
1993-03-21 12:45:37 +03:00
perror ("mount");
exit (1);
}
exit (0);
}