lkml.org 
[lkml]   [2000]   [Aug]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectUsing 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(&current->sigmask_lock);
current->blocked = set;
spin_unlock_irq(&current->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/

\
 
 \ /
  Last update: 2005-03-22 13:58    [W:0.054 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site