enter main process 2241
child process 2242 created by 2241
SIGCHLD from process 2242
normal termination, exit status = 1
waitpid returns -1
child process 2244 created by 2241
SIGCHLD from process 2244
normal termination, exit status = 0
waitpid returns 0
child process 2243 created by 2241
SIGCHLD from process 2243
abnormal termination, signal number = 6,
waitpid returns -1
main process 2241 exited
本文通过一个具体的C语言示例程序,演示了如何使用Linux系统调用创建子进程,并通过信号处理函数管理进程的终止状态。文章详细介绍了SIGCHLD信号的捕获与处理过程,以及如何获取进程退出的状态信息。
492

被折叠的 条评论
为什么被折叠?



