/* $OpenBSD: __syscall.c,v 1.2 2002/02/13 16:24:25 art Exp $ */ /* * Written by Artur Grabowski 2002 Public Domain. */ #include #include #include #include #include #include int main() { int status; switch(fork()) { case -1: err(1, "fork"); case 0: __syscall((u_int64_t)SYS_exit, (u_int64_t)17); abort(); } if (wait(&status) < 0) err(1, "wait"); if (!WIFEXITED(status)) errx(1, "child didn't exit gracefully"); if (WEXITSTATUS(status) != 17) errx(1, "wrong exit status"); return 0; }