《操作系统》的实验代码。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

18 lines
263 B

#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;
}