os_kernel_lab/labcodes/lab7/user/sleepkill.c

19 lines
263 B
C
Raw Normal View History

2012-08-22 12:32:13 +08:00
#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;
}