Messages in this thread | | | From | wesf@us ... | Date | Mon, 7 Aug 2000 19:41:48 -0400 | Subject | Using queued realtime signals in a kernel thread |
| |
In a module I'm writing I am trying to do event-driven I/O using queued realtime signals. Unfortunately, the signals are never sent when data arrives on a socket that my module is interested in, which makes me think that I'm not setting things up right. Currently I use this code when my kernel thread starts:
sigset_t set; sigemptyset(&set); sigaddset(&set, signum); /* set our blocked mask to set */ spin_lock_irq(¤t->sigmask_lock); current->blocked = set; spin_unlock_irq(¤t->sigmask_lock);
Then when I want to start paying attention to a particular socket, I do this (all variables have been initialized to sensible values):
if((err = sys_fcntl(fd, F_SETFL, O_RDWR|O_NONBLOCK|O_NDELAY)) < 0) goto out; if((err = sys_fcntl(fd, F_SETSIG, signum)) < 0) goto out; if((err = sys_fcntl(fd, F_SETOWN, current->pid)) < 0) goto out;
As far as I can tell, it doesn't work. I've been reading the code, but it's not helping. Big thanks in advance if anyone wants to lend a clue.
Wesley Felter - wesf@us.ibm.com IBM Austin Research Lab
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |