I have a bunch of pthreads, each blocking on a system call such as recv() and wait().
I want to interrupt them (and make them return with errno = EINTR) when a signal arrives, so I use sigaction() without SA_RESTART to set an interrupt handler. The end goal is to gracefully exit the whole program.
However, it seems that only the thread that handles the signal got interrupted, while the other threads keep blocking on their system calls.
How do I interrupt all of them?