xref: /freebsd/contrib/netbsd-tests/rump/rumpkern/h_client/h_simplecli.c (revision 9268022b74279434ed6300244e3f977e56a8ceb5)
1*57718be8SEnji Cooper /*	$NetBSD: h_simplecli.c,v 1.2 2011/01/14 13:23:15 pooka Exp $	*/
2*57718be8SEnji Cooper 
3*57718be8SEnji Cooper #include <sys/types.h>
4*57718be8SEnji Cooper 
5*57718be8SEnji Cooper #include <err.h>
6*57718be8SEnji Cooper #include <stdlib.h>
7*57718be8SEnji Cooper #include <stdio.h>
8*57718be8SEnji Cooper #include <unistd.h>
9*57718be8SEnji Cooper 
10*57718be8SEnji Cooper #include <rump/rump_syscalls.h>
11*57718be8SEnji Cooper #include <rump/rumpclient.h>
12*57718be8SEnji Cooper 
13*57718be8SEnji Cooper int
main(int argc,char * argv[])14*57718be8SEnji Cooper main(int argc, char *argv[])
15*57718be8SEnji Cooper {
16*57718be8SEnji Cooper 
17*57718be8SEnji Cooper 	if (rumpclient_init() == -1)
18*57718be8SEnji Cooper 		err(1, "rumpclient init");
19*57718be8SEnji Cooper 
20*57718be8SEnji Cooper 	if (argc > 1) {
21*57718be8SEnji Cooper 		for (;;) {
22*57718be8SEnji Cooper 			rump_sys_getpid();
23*57718be8SEnji Cooper 			usleep(10000);
24*57718be8SEnji Cooper 		}
25*57718be8SEnji Cooper 	} else {
26*57718be8SEnji Cooper 		if (rump_sys_getpid() > 0)
27*57718be8SEnji Cooper 			exit(0);
28*57718be8SEnji Cooper 		err(1, "getpid");
29*57718be8SEnji Cooper 	}
30*57718be8SEnji Cooper }
31