2023年9月19日

linux wait函数 : 处理僵尸进程(进程回收)

摘要: 进程回收 在每个进程退出的时候,内核释放该进程所有的资源、包括打开的文件、占用的内存等。但是仍然为其保留一定的信息,这些信息主要指进程控制块 PCB 的信息(进程号、退出状态、运行时间等) 父进程可以通过调用 wait 或 waitpid 得到它的退出状态同时彻底清除这个进程。 wait() 和 w 阅读全文

posted @ 2023-09-19 17:33 廿陆 阅读(269) 评论(0) 推荐(0)

linux进程退出 孤儿进程 僵尸进程

摘要: 进程退出 #include <stdlib.h> void exit(int status); #include <unistd.h> void _exit(int status); 1 /* 2 #include <stdlib.h> 3 void exit(int status); 4 5 #i 阅读全文

posted @ 2023-09-19 11:15 廿陆 阅读(29) 评论(0) 推荐(0)

导航