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