1 /* $NetBSD: h_simpleserver.c,v 1.1 2010/11/30 22:09:15 pooka Exp $ */ 2 3 #include <sys/types.h> 4 5 #include <rump/rump.h> 6 7 #include <err.h> 8 #include <stdlib.h> 9 #include <unistd.h> 10 11 #define NOFAIL(e) do { int rv = e; if (rv) err(1, #e); } while (/*CONSTCOND*/0) 12 13 int 14 main(int argc, char *argv[]) 15 { 16 17 if (argc != 2) 18 exit(1); 19 20 NOFAIL(rump_daemonize_begin()); 21 NOFAIL(rump_init()); 22 NOFAIL(rump_init_server(argv[1])); 23 NOFAIL(rump_daemonize_done(RUMP_DAEMONIZE_SUCCESS)); 24 25 for (;;) 26 pause(); 27 } 28