Re: signal handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 5/13/06, Nish Aravamudan <nish.aravamudan@xxxxxxxxx> wrote:
On 5/12/06, Talib Alim <talibalm@xxxxxxxxxxx> wrote:
> Some of the functions in my kernel module can sleep, for these functions I
> have following code
>
> if (signal_pending(current))
>     {
>      set_current_state(TASK_RUNNING);
>      *errno = EINTR;
>      return(something);
>     }

You need to post more than 4 lines of code to get help, e.g. where is
this with respect to your "sleeping" code?

> The problem is that even if I do ctrl-Z on the key board, abouve code
> returns and user process stops.

What do you expect to happen? How do you know your user process (that
you suspended) is executing in your kernel module? I can't tell,
because you didn't paste the relevant code.

> What is the correct way of handling this ? should I check for specified
> signals, e.g. man 7 signal says that following signal should kill the
> process and some of them shuold also do core

What are you actually trying to do? Please make it clear and concise,
and post it along with all of the code.

what i think Talib wants is to catch specific signal
signal_pending(current) will return true if *any* signal is pending for this process
what Talib wants is a function like
spec_signal_pending(current, SIGTERM) for example
looking to definition of struct sigpending at:
http://lxr.linux.no/source/include/linux/signal.h#L28
which is part of task_struct, can we check the struct "sigpending" looking for the signal we are interested in
any one CMIIW please
hope this helps

--
MHD.Tayseer

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux