What is the difference between sigaction and signal?

前端 未结 9 795
离开以前
离开以前 2020-11-22 06:23

I was about to add an extra signal handler to an app we have here and I noticed that the author had used sigaction() to set up the other signal handlers. I was

9条回答
  •  一整个雨季
    2020-11-22 06:47

    I would also suggest using sigaction() over signal() and would like to add one more point. sigaction() gives you more options such as pid of the process that died (possible using the siginfo_t struct).

提交回复
热议问题