What is the difference between sigaction and signal?

前端 未结 9 790
离开以前
离开以前 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:57

    From the signal(3) man page:

    DESCRIPTION

     This signal() facility is a simplified interface to the more
     general sigaction(2) facility.
    

    Both invoke the same underlying facility. You should presumably not manipulate the response the a single signal with both, but mixing them shouldn't cause anything to break...

提交回复
热议问题