Re: Sock_recvmsg() blocks and is not killable

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

 



On Fri, Jan 27, 2006 at 14:25:44 +0530, Jitesh Shah wrote:
> Hi,
>  
> I am using the "kill_proc" function to kill the thread. This is called
> from the main thread, which had created this process. If you can please
> go to the first posting, the entire code is listed there.
>  
> void stop_client(void) 
> { 
> If(g_pid != -1) 
> {
> lock_kernel();
> killproc(g_pid, SIGKILL, 1); 
> unlock_kernel();
> } 
> } 

Note, that kernel threads are never going to handle signals. Even SIGKILL.
That is because signals are ONLY handled during return to userland -- and
kernel threads don't have userland to return to. Also I believe signals are
blocked by default in kernel threads and you have to unblock them (I don't
recall exactly how, but you should find it in this list archives somewhere).
Then recv_msg should return upon receiving the signal, but it's caller has to
check what signal actually arrived and arrange the thread to exit.

-- 
						 Jan 'Bulb' Hudec <bulb@xxxxxx>

Attachment: signature.asc
Description: Digital signature


[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