This is another follow up to your answer to my question. In _syscallN(arguments), it will call interrupt 0x80 to call the _system_call which will finally call the actual code that needs to be executed. Can it be done in a way to directly call 0x80 interrupt by passing the sigaction argument it requires. In this way, the user to kernel context switching can be overcome, and a signal handler can also be added. Is this a good idea??? Thanks, venu ----- Original Message ----- From: "Jan Hudec" <bulb@ucw.cz> To: <kernelnewbies@nl.linux.org> Sent: Thursday, May 30, 2002 10:59 AM Subject: Re: how to add signal handler to kernel thread? > On Thu, May 30, 2002 at 11:55:52AM +0100, venugopal panchamukhi wrote: > > Hi, > > Could anyone let me know the procedure to add a signal handler for a kernel thread which is created using kernel_thread(). > > AFAIK signals are delivered only on exit from kernel mode (which happens > either at the end of a syscall or after interrupt (which may have caused > the signal), scheduling being a special case of this. Since kernel > thread never leaves a kernel mode, the code to run signal handlers is > never executed. You have to check for current->signals every time you > wake up and if there is a signal, handle it. You will find all relevant > data about the signal somewhere in current. Of course you want to make > sure you sleep in TASK_INTPERRUPTIBLE state so you get scheduled when > signal arrives. > > -------------------------------------------------------------------------- ------ > - Jan Hudec `Bulb' <bulb@ucw.cz> > -- > Kernelnewbies: Help each other learn about the Linux kernel. > Archive: http://mail.nl.linux.org/kernelnewbies/ > FAQ: http://kernelnewbies.org/faq/ > -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/