386BSD 0.1 development
[unix-history] / usr / src / sbin / mount_isofs / mount_isofs.c
#include <stdio.h>
#include <sys/types.h>
#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;
extern char *optarg;
extern int optind;
int opts;
opts = MNT_RDONLY;
while ((c = getopt (argc, argv, "F:")) != EOF) {
switch (c) {
case 'F':
opts |= atoi (optarg);
break;
default:
usage ();
}
}
if (optind + 2 != argc)
usage ();
dev = argv[optind];
dir = argv[optind + 1];
args.fspec = dev;
args.exflags = MNT_EXRDONLY;
args.exroot = 0;
if (mount (MOUNT_ISOFS, dir, MNT_RDONLY, &args) < 0) {
perror ("mount");
exit (1);
}
exit (0);
}