Warning: Attempt to read property "date" on null in /usr/local/www/websvn.planix.org/blame.php on line 247

Warning: Attempt to read property "msg" on null in /usr/local/www/websvn.planix.org/blame.php on line 247
WebSVN – planix.SVN – Blame – /os/branches/feature_posix/sys/src/9/boot/testboot.c – Rev 2

Subversion Repositories planix.SVN

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 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
}