Skip to content
Advertisement

Signals in ppoll not handled immediately

I wrote a small ppoll test but I am confused about the signal handling. The man page says:

The relationship between poll() and ppoll() is analogous to the relationship between select(2) and pselect(2): like pselect(2), ppoll() allows an application to safely wait until either a file descriptor becomes ready or until a signal is caught.

In my case fd changes are handled immediately while signals are handled after the timeout. I used ctr-c in the process context and kill from another shell but always the same behavior.

What am I doing wrong? Did I miss something?

JavaScript

Advertisement

Answer

When you called ppoll, you told it to block SIGINT and SIGTERM by passing them in the signal mask.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement