Signal queuing in C

前端 未结 4 1912
南方客
南方客 2020-12-03 00:07

I have a simple program under Linux which sends SIGUSR1 signal to its child process in a cycle. But when I send e.g. 10 signals, sometimes happens, that the child received o

4条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-03 00:34

    Your problem is probably that SIGUSR2 is a signal that is delivered right away, while other signals are blocked or queued (in status pending).

    Here's how you can check for pending signals: http://www.gnu.org/s/libc/manual/html_node/Checking-for-Pending-Signals.html

提交回复
热议问题