tech-kern archive

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

checking for a closed socket



Hello,
I've been debugging an issue wuth Xen, where xenstored loops at 100%
CPU on poll(2).
after code analysis it's looping on closed Unix socket desriptors.
From what I understood the code expect poll(2) to return something
different from POLLIN when the remote end of the socket is
closed (it checks for (~(POLLOUT|POLLIN)) to it could be either
POLLERR or POLLHUP I guess - or eventually POLLRDHUP which we don't have).

Who is right here, linux or NetBSD (linux claims to be posix, while
our man page doens't mention it) ?

Is there a way to check if a connection has been closed without a read() ?

-- 
Manuel Bouyer <bouyer%antioche.eu.org@localhost>
     NetBSD: 26 ans d'experience feront toujours la difference
--


Home | Main Index | Thread Index | Old Index