I'm trying to use pselect() to handle kernel driver signals (i.e. SIGINT, SIGIO, etc) as well as file descriptor notices, which is all within the realm of things pselect() can do, however I'm having a hard time stimulating my implementation to test it. I need help figuring out how to generate kernel signals such as SIGINT, SIGIO and make pselect() detect them.

I was wondering if anyone knew of a way to check out the pselect() signal handling functionality? I was trying to do this with the Linux serial port drivers, but fell short since I don't know how to make the ttyS0 driver generate a signal so that pselect() can be interrupted and the signal handled?

Here's a snippet of code for how I'm using the pselect().

{
sigset_t emptyset, blockset;

sigemptyset(&blockset); /* Block SIGINT */
sigaddset(&blockset, SIGINT);
sigprocmask(SIG_BLOCK, &blockset, NULL);

sa.sa_handler = handler; /* Establish signal handler */
sa.sa_flags = 0;
sigemptyset(&sa.sa_mask);
sigaction(SIGINT, &sa, NULL);

/* Initialize nfds and readfds, and perhaps do other work here */
/* Unblock signal, then wait for signal or ready file descriptor */

sigemptyset(&emptyset);
ready = pselect(nfds, &readfds, NULL, NULL, NULL, &emptyset);
...
}