且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

信号处理用C - 中断中断

更新时间:2022-05-10 21:19:44

引述的sigaction(2)手册页:

信号程序通常与导致信号执行其
  调用阻止,但是还可能发生其它的信号。一个全球性的信号掩码
  定义了一套从目前交付给一个进程阻塞信号。
  一个进程的信号掩码是从其父初始化
  (通常为空)。它可以与 sigprocmask改变(2)电话,或当
  信号被传递到过程

Signal routines normally execute with the signal that caused their invocation blocked, but other signals may yet occur. A global signal mask defines the set of signals currently blocked from delivery to a process. The signal mask for a process is initialized from that of its parent (normally empty). It may be changed with a sigprocmask(2) call, or when a signal is delivered to the process.

您可以控制​​信号是否被自动阻止与 SA_NODEFER 标志其信号处理程序。

You can control whether the signal is automatically blocked in its signal handler with the SA_NODEFER flag.