1/* 2 * Copyright (c) 1992, 1993, 1994 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software donated to Berkeley by 6 * Jan-Simon Pendry. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 58 unchanged lines hidden (view full) --- 67int 68main(argc, argv) 69 int argc; 70 char *argv[]; 71{ 72 struct null_args args; 73 int ch, mntflags; 74 char target[MAXPATHLEN]; |
75 struct vfsconf *vfc; |
76 77 mntflags = 0; 78 while ((ch = getopt(argc, argv, "o:")) != EOF) 79 switch(ch) { 80 case 'o': 81 getmntopts(optarg, mopts, &mntflags); 82 break; 83 case '?': --- 10 unchanged lines hidden (view full) --- 94 err(1, "%s", target); 95 96 if (subdir(target, argv[1]) || subdir(argv[1], target)) 97 errx(1, "%s (%s) and %s are not distinct paths", 98 argv[0], target, argv[1]); 99 100 args.target = target; 101 |
102 vfc = getvfsbyname("null"); 103 if(!vfc && vfsisloadable("null")) { 104 if(vfsload("null")) 105 err(1, "vfsload(null)"); 106 endvfsent(); /* flush cache */ 107 vfc = getvfsbyname("null"); 108 } 109 110 if (mount(vfc ? vfc->vfc_index : MOUNT_NULL, argv[1], mntflags, &args)) |
111 err(1, NULL); 112 exit(0); 113} 114 115int 116subdir(p, dir) 117 const char *p; 118 const char *dir; --- 20 unchanged lines hidden --- |