os_kernel_lab/labcodes_answer/lab8_result/user/sleepkill.c
2014-08-20 15:42:20 +08:00

19 lines
263 B
C

#include <stdio.h>
#include <ulib.h>
int
main(void) {
int pid;
if ((pid = fork()) == 0) {
sleep(~0);
exit(0xdead);
}
assert(pid > 0);
sleep(100);
assert(kill(pid) == 0);
cprintf("sleepkill pass.\n");
return 0;
}