The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/boot/testboot.c

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 #include <u.h>
    2 #include <libc.h>
    3 #include <auth.h>
    4 
    5 void
    6 usage(void)
    7 {
    8         fprint(2, "usage: testboot cmd args...\n");
    9         exits("usage");
   10 }
   11 
   12 void
   13 main(int argc, char **argv)
   14 {
   15         int p[2];
   16 
   17         if(argc == 1)
   18                 usage();
   19 
   20         pipe(p);
   21         switch(rfork(RFPROC|RFFDG|RFNAMEG)){
   22         case -1:
   23                 sysfatal("fork: %r");
   24 
   25         case 0:
   26                 dup(p[0], 0);
   27                 dup(p[1], 1);
   28                 exec(argv[1], argv+1);
   29                 sysfatal("exec: %r");
   30 
   31         default:
   32                 if(amount(p[0], "/n/kremvax", MREPL, "") < 0)
   33                         sysfatal("amount: %r");
   34                 break;
   35         }
   36         exits(nil);
   37 }

Cache object: f0926f6bdd0858c8fda43fcfac698441


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.