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(); }
ATF_TC_BODY(sigignore, tc) { rump_boot_setsigmodel(RUMP_SIGMODEL_IGNORE); rump_init(); rump_schedule(); rumptest_localsig(SIGKILL); rump_unschedule(); }
ATF_TC_BODY(sigraise, tc) { signal(SIGUSR2, thehand); rump_boot_setsigmodel(RUMP_SIGMODEL_RAISE); rump_init(); rump_schedule(); rumptest_localsig(SIGUSR2); rump_unschedule(); ATF_REQUIRE_EQ(sigcnt, 1); }
void bmk_mainthread(void *cmdline) { int rv; rump_boot_setsigmodel(RUMP_SIGMODEL_IGNORE); rv = rump_init(); bmk_printf("rump kernel init complete, rv %d\n", rv); while(1); }
ATF_TC_BODY(sigpanic, tc) { int status; rump_boot_setsigmodel(RUMP_SIGMODEL_PANIC); switch (fork()) { case 0: rump_init(); rump_schedule(); rumptest_localsig(SIGCONT); /* NOTREACHED */ exit(1); default: wait(&status); ATF_REQUIRE(WIFSIGNALED(status) && WTERMSIG(status) == SIGABRT); break; case -1: atf_tc_fail_errno("fork"); } }