Re: SIGURG

Matthias Urlichs (smurf@noris.de)
12 Nov 1999 09:45:36 +0100


Jay Thorne <jay@result.com> writes:
> According to my Database vendor, SIGURG is not reliable on Linux systems.
>
Yes it is. ;-)

> don't have the knowledge to know how SIGURG is supposed to work, but
> apparently its only delivered once for a given process on a linux system,

No. It is sent once for a given batch of urgent data.

Your database vendor has made at least one mistake. Either (very likely)
they just don't understand how signal() is supposed to work, i.e. not at
all -- they should use sigaction() or, at the very least, bsd_signal().

It look like they're using the sysv_signal() wrapper (or the SA_RESETHAND
flag to sigaction()), which deinstalls the signal handler after the
signal is delivered. Since SIGURG is ignored by default, you'll never
notice...

The other failure mode is when a new packet of urgent data arrives before
the program has read the first one. Then the program returns from the
handler, but doesn't empty the queue. Thus, it won't ever get a second
SIGURG signal.

This is testable with netstat, which will show data sitting on the
socket.

-- 
Matthias Urlichs  |  noris network GmbH   |   smurf@noris.de  |  ICQ: 20193661
The quote was selected randomly. Really.    |      http://www.noris.de/~smurf/
-- 
Fortunately, the second-to-last bug has just been fixed.

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/