1 /* 2 * Copyright (c) 1990, 1992 Jan-Simon Pendry 3 * Copyright (c) 1992, 1993 4 * The Regents of the University of California. All rights reserved. 5 * 6 * This code is derived from software contributed to Berkeley by 7 * Jan-Simon Pendry. 8 * 9 * %sccs.include.redist.c% 10 * 11 * @(#)mount_fdesc.c 8.1 (Berkeley) 06/05/93 12 */ 13 14 #include <sys/param.h> 15 #include <sys/mount.h> 16 17 #include <errno.h> 18 #include <unistd.h> 19 #include <stdio.h> 20 #include <stdlib.h> 21 #include <string.h> 22 23 void usage __P((void)); 24 25 int 26 main(argc, argv) 27 int argc; 28 char *argv[]; 29 { 30 int ch, mntflags; 31 32 mntflags = 0; 33 while ((ch = getopt(argc, argv, "F:")) != EOF) 34 switch(ch) { 35 case 'F': 36 mntflags = atoi(optarg); 37 break; 38 case '?': 39 default: 40 usage(); 41 } 42 argc -= optind; 43 argv += optind; 44 45 if (argc != 2) 46 usage(); 47 48 if (mount(MOUNT_FDESC, argv[1], mntflags, NULL)) { 49 (void)fprintf(stderr, "mount_fdesc: %s\n", strerror(errno)); 50 exit(1); 51 } 52 exit(0); 53 } 54 55 void 56 usage() 57 { 58 (void)fprintf(stderr, 59 "usage: mount_fdesc [ -F fsoptions ] /dev/fd mount_point\n"); 60 exit(1); 61 } 62