signal_pending() and schedule()

From: Melkor Ainur (melkorainur@yahoo.com)
Date: Tue Mar 26 2002 - 19:19:55 EST


Hello all,

I have been writing a hw driver for SAN. In my
implementation of tcp_sendmsg, I attempt to force
the application to sleep until the data buffer has
been dma-ed:

    if (signal_pending(current)) {
      return -ERESTARTSYS;
    }
// no signal was pending

// timeo == MAX_SCHEDULE_TIMEOUT in this case
    timeo = schedule_timeout(timeo);
// signal is always pending
    if (signal_pending(current)) {
      return -ERESTARTSYS;
    }
This works fine for some applications like netcat,etc
but fails for netscape. In debugging this, I observe
that after calling schedule_timeout(), the sigpending
bit appears to be set immediately and thus
schedule() doesn't actually put the process to sleep.
I will continue to look for where schedule_timeout()
or schedule() could affect sigpending. In the mean
time, I am hoping for any hints/suggestions that could
help me solve this issue of why schedule_timeout
appears to affect sigpending. (2.4.7-10smp on x86)

                                    Thanks,
                                    Melkor

__________________________________________________
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards®
http://movies.yahoo.com/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Mar 31 2002 - 22:00:12 EST