NetBSD/sbin/mount_isofs/mount_isofs.c

59 lines
902 B
C
Raw Normal View History

1993-03-22 11:04:00 +03:00
#ifndef lint
1993-07-19 17:31:39 +04:00
static char rcsid[] = "$Header: /cvsroot/src/sbin/mount_isofs/Attic/mount_isofs.c,v 1.5 1993/07/19 13:31:39 cgd Exp $";
1993-03-22 11:04:00 +03:00
#endif
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 ufs_args args;
int c;
int opts;
opts = MNT_RDONLY;
1993-07-19 17:31:39 +04:00
argc--;
argv++;
while (argc > 2) {
if (!strcmp("-F", argv[0])) {
argc--; argv++;
opts |= atoi(argv[0]);
argc--; argv++;
} else if (!strcmp(argv[0], "-norrip")) {
opts |= ISOFSMNT_NORRIP;
argc--; argv++;
} 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.exflags = MNT_EXRDONLY | opts;
1993-03-21 12:45:37 +03:00
args.exroot = 0;
if (mount (MOUNT_ISOFS, dir, MNT_RDONLY, &args) < 0) {
perror ("mount");
exit (1);
}
exit (0);
}