Er, forgot to send the signal. Corrected test case:
#include <stdio.h>
#include <signal.h>
#include <assert.h>
int main(int argc, char **argv)
{
sigset_t sigset;
siginfo_t info;
static struct timespec timeout = {0,0};
// block delivery of SIGRTMIN
sigemptyset(&sigset);
sigaddset(&sigset, SIGRTMIN);
assert(0 == sigprocmask(SIG_BLOCK, &sigset, NULL));
raise(SIGRTMIN);
// clear signal queue
assert(0 == signal(SIGRTMIN, SIG_IGN)); // POSIX says this clears the queue
// Make sure that cleared the queue. (Note that timeout is zero here.)
assert(sigtimedwait(&sigset, &info, &timeout) != SIGRTMIN);
printf("test passed\n");
exit(0);
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/