void _netbsd_init(void) { thestrings.ps_argvstr = (void *)((char *)&myaux - 2); __ps_strings = &thestrings; pthread__stacksize = 2*STACK_SIZE; rump_boot_setsigmodel(RUMP_SIGMODEL_IGNORE); rump_init(); environ = the_env; _lwp_rumpxen_scheduler_init(); runinit(); _libc_init(); /* XXX: we should probably use csu, but this is quicker for now */ __progname = "rumpxenstack"; #ifdef RUMP_SYSPROXY rump_init_server("tcp://0:12345"); #endif /* * give all threads a chance to run, and ensure that the main * thread has gone through a context switch */ sched_yield(); }
int main(int argc, char *argv[]) { #ifdef RUMP_SYSPROXY rump_init_server("tcp://0:12345"); #endif if (bmk_havenet) nettest(); disktest(); printf("\nTHE END\n"); return 0; }
int main(int argc, char *argv[]) { pthread_t pt; struct md_conf md; int fd, error; if (argc != 2) exit(1); md.md_addr = calloc(1, MDSIZE); md.md_size = MDSIZE; md.md_type = MD_UMEM_SERVER; error = rump_daemonize_begin(); REQUIRE(error, "rump_daemonize_begin"); error = rump_init(); REQUIRE(error, "rump_init"); error = rump_init_server("unix://commsock"); REQUIRE(error, "init server"); if ((fd = rump_sys_open(argv[1], O_RDWR)) == -1) err(1, "open"); /* * Now, configuring the md driver also causes our process * to start acting as the worker for the md. Splitting it * into two steps in the driver is not easy, since md is * supposed to be unconfigured when the process dies * (process may exit between calling ioctl1 and ioctl2). * So, start a probe thread which attempts to read the md * and declares the md as configured when the read is * succesful. */ error = pthread_create(&pt, NULL, prober, argv[1]); REQUIRE(error, "pthread_create"); pthread_detach(pt); if (rump_sys_ioctl(fd, MD_SETCONF, &md) == -1) { rump_daemonize_done(errno); exit(1); } return 0; }