用系统调用signal()让父进程捕捉键盘上来的中断信号(按Ctrl-C键);当捕捉到中断信号后,父进程用系统调用kill()向两个子进程发出信号,子进程捕捉到信号后分别输出下列信息后终止: Child Process 1 is Killed by Parent! Child Process 2 is Killed by Parent! 父进程等待两个子进程终止后,输出如下的信息后终止: Parent Process is Killed!
标签:
signal
Ctrl-C
中断
信号
上传时间:
2015-02-27
上传用户:ywqaxiwang