NetBSD/sbin/mount_isofs/mount_isofs.c

59 lines
870 B
C
Raw Normal View History

1993-03-22 11:04:00 +03:00
#ifndef lint
1993-03-23 03:22:59 +03:00
static char rcsid[] = "$Header: /cvsroot/src/sbin/mount_isofs/Attic/mount_isofs.c,v 1.3 1993/03/23 00:29:01 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>
#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);
}