《操作系统》的实验代码。
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

преди 10 години
  1. #include <stdio.h>
  2. #include <ulib.h>
  3. int
  4. main(void) {
  5. int pid;
  6. if ((pid = fork()) == 0) {
  7. sleep(~0);
  8. exit(0xdead);
  9. }
  10. assert(pid > 0);
  11. sleep(100);
  12. assert(kill(pid) == 0);
  13. cprintf("sleepkill pass.\n");
  14. return 0;
  15. }