|
|
发表于 2006-2-21 22:21:29
|
显示全部楼层
Post by co63
- // test.c
- #include <stdlib.h>
- #include <stdio.h>
- int main()
- {
- if(fork())
- {
- while(1)
- sleep(100);
- }
- exit(0);
- }
复制代码
gcc编译后,运行a.out
然后在进程中找[a.out] <defunct>
用kill -9 id号是杀不掉的。 非也,[a.out] <defunct> 是杀不掉,但是./a.out的pid就能杀掉
4025 tty1 S+ 0:00 ./a.out
4026 tty1 Z+ 0:00 [a.out] <defunct>
4063 tty2 R+ 0:00 ps ax
kill -9 4025 是可以杀死它的,同样,用 killall -9 a.out 也能杀掉 |
|