-1
是否有可能使用C中的信号来运行父进程和子进程,并且当按下随机控制的C(SIGINT)时,会向父进程传递一个整数以传递给子进程通过管道。C获取信号发送值
伪代码:
main:
-call firstfunction
handler:
-handler for SIGINT
-call second function if SIGINT is live
firstfunction:
-create pipe, fork for child
-let OS know to handle SIGINT
secondfunction:
-handler for control C signal
-return a INT value to firstfunction parent process
我竭力想看看我将如何去有关secondfunction实际代码。
缺少分号。在线#1 – wildplasser 2014-12-19 01:03:33
对不起?它的pseduco代码。 “随机”的 – lecardo 2014-12-19 01:08:40
与“异步”非常不同。 – 2014-12-19 02:15:33