Home | History | Annotate | Line # | Download | only in mount_msdos
mount_msdos.c revision 1.2
      1 /*
      2  * Who wrote this???
      3  */
      4 
      5 #ifndef lint
      6 static char rcsid[] = "$Id: mount_msdos.c,v 1.2 1993/08/02 17:51:11 mycroft Exp $";
      7 #endif /* not lint */
      8 
      9 #include <stdio.h>
     10 #include <sys/types.h>
     11 #include <sys/mount.h>
     12 
     13 char *progname;
     14 
     15 void
     16 usage ()
     17 {
     18 	fprintf (stderr, "usage: %s bdev dir\n", progname);
     19 	exit (1);
     20 }
     21 
     22 int
     23 main (argc, argv)
     24 int argc;
     25 char **argv;
     26 {
     27 	char *dev;
     28 	char *dir;
     29 	struct pcfs_args args;
     30 	int c;
     31 	extern char *optarg;
     32 	extern int optind;
     33 	int opts;
     34 
     35 	progname = argv[0];
     36 
     37 	opts = 0;
     38 
     39 	while ((c = getopt (argc, argv, "F:")) != EOF) {
     40 		switch (c) {
     41 		case 'F':
     42 			opts |= atoi (optarg);
     43 			break;
     44 		default:
     45 			usage ();
     46 		}
     47 	}
     48 
     49 	if (optind + 2 != argc)
     50 		usage ();
     51 
     52 	dev = argv[optind];
     53 	dir = argv[optind + 1];
     54 
     55 	args.fspec = dev;
     56 	args.exflags = 0;
     57 	args.exroot = 0;
     58 
     59 	if (mount (MOUNT_MSDOS, dir, opts, &args) < 0) {
     60 		perror ("mount");
     61 		exit (1);
     62 	}
     63 
     64 	exit (0);
     65 }
     66