RE: Sock_recvmsg() blocks and is not killable

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

 



Adil,
 
Thanks for your response. The problem is not what you might be thinking. The problem is that the recv function is itself blocked till a valid packet is received. The recv function doesnt exit until a valid packet is received. The condition when a packet of size less than equal zero byte is received simply doesnt occur.
 
I dunno if it helps to add that I am using linux kernel 2.4.19.
 
Regards
 


From: Adil Mujeeb [mailto:mujeeb.adil@xxxxxxxxx]
Sent: Thursday, January 26, 2006 9:47 AM
To: Jitesh Shah
Cc: kernelnewbies@xxxxxxxxxxxx
Subject: Re: Sock_recvmsg() blocks and is not killable


Replace the following code

        while(len <= 0)
        {
              len = recv(g_socket, data_buff, rx_buff_size, 0);
        }
       
        if(get_pending_signal(current))
        {
            break;
        }

like this :     
        while(len <= 0)

        {
              len = recv(g_socket, data_buff, rx_buff_size, 0);
          /* check signal here*/
          if(get_pending_signal(current))
             {
             signal_flag = 1; /*add a flag for signal, to keep ur logic */
                  break;
             }
        }
       
        if(signal_flag)
        {
            break;
        }

Hope it will work
Rgds,
Adil

[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