Subject: Re: AF_LOCAL, SOCK_STREAM and poll(2)
To: None <mmondor@gobot.ca>
From: Jaromir Dolecek <jdolecek@netbsd.org>
List: tech-kern
Date: 08/14/2002 16:52:08
When the other side of socket disconnects, you are supposed to get
POLLIN from poll, and then get zero length read() == EOF. Is this
not good enough?

Matthew Mondor wrote:
> Hi,
> 
> I recently noticed something which may or may not be of interest, about
> not obtaining poll() POLLHUP or POLLERR event when a unix domain stream
> client socket disconnects, using NetBSD 1.5.2 (I could not test the same
> code on NetBSD 1.5.3 yet).
> 
> Is that expected behavior, and if so, how would I efficiently detect
> disconnection events to close the fd and recycle the pollfd array entry
> for it, as would be performed with the inet domain? Although that issue
> mostly concerns userspace, kernel is responsible for handling poll()
> events so I thought I would post here...
> 
> Thanks,
> Matt
> 


-- 
Jaromir Dolecek <jdolecek@NetBSD.org>            http://www.NetBSD.org/
-=- We should be mindful of the potential goal, but as the tantric    -=-
-=- Buddhist masters say, ``You may notice during meditation that you -=-
-=- sometimes levitate or glow.   Do not let this distract you.''     -=-