155338Spendry /* 255338Spendry * Copyright (c) 1990, 1992 Jan-Simon Pendry 3*61507Sbostic * Copyright (c) 1992, 1993 4*61507Sbostic * The Regents of the University of California. All rights reserved. 555338Spendry * 655338Spendry * This code is derived from software contributed to Berkeley by 755338Spendry * Jan-Simon Pendry. 855338Spendry * 955338Spendry * %sccs.redist.c.% 1055338Spendry * 11*61507Sbostic * @(#)mount_kernfs.c 8.1 (Berkeley) 06/05/93 1255338Spendry */ 1355338Spendry 1455338Spendry #include <sys/param.h> 1555338Spendry #include <sys/mount.h> 1655338Spendry 1755338Spendry #include <errno.h> 1855338Spendry #include <unistd.h> 1955338Spendry #include <stdio.h> 2055338Spendry #include <stdlib.h> 2155338Spendry #include <string.h> 2255338Spendry 2355338Spendry void usage __P((void)); 2455338Spendry 2555338Spendry int 2655338Spendry main(argc, argv) 2755338Spendry int argc; 2855338Spendry char *argv[]; 2955338Spendry { 3055338Spendry int ch, mntflags; 3155338Spendry 3255338Spendry mntflags = 0; 3355338Spendry while ((ch = getopt(argc, argv, "F:")) != EOF) 3455338Spendry switch(ch) { 3555338Spendry case 'F': 3655338Spendry mntflags = atoi(optarg); 3755338Spendry break; 3855338Spendry case '?': 3955338Spendry default: 4055338Spendry usage(); 4155338Spendry } 4255338Spendry argc -= optind; 4355338Spendry argv += optind; 4455338Spendry 4555338Spendry if (argc != 2) 4655338Spendry usage(); 4755338Spendry 4855338Spendry if (mount(MOUNT_KERNFS, argv[1], mntflags, NULL)) { 4955338Spendry (void)fprintf(stderr, "mount_kernfs: %s\n", strerror(errno)); 5055338Spendry exit(1); 5155338Spendry } 5255338Spendry exit(0); 5355338Spendry } 5455338Spendry 5555338Spendry void 5655338Spendry usage() 5755338Spendry { 5855338Spendry (void)fprintf(stderr, 5955338Spendry "usage: mount_kernfs [ -F fsoptions ] /kern mount_point\n"); 6055338Spendry exit(1); 6155338Spendry } 62