Editing POLLHUP polling

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 124: Line 124:


* POLLIN if checking
* POLLIN if checking
* POLLHUP always, even when checking for no events
* POLLHUP always


This is regardless of whether there is data in the socket to read.
This is regardless of whether there is data in the socket to read.
Line 134: Line 134:
The history of FreeBSD's behaviour is as follows:
The history of FreeBSD's behaviour is as follows:


* 1997: [https://svnweb.freebsd.org/base?view=revision&revision=29351 FreeBSD r29351 implements poll] based on NetBSD's code. POLLHUP is not returned by sockets
* 1997: [https://svnweb.freebsd.org/base?view=revision&revision=29351 FreeBSD implements poll] based on NetBSD's code. POLLHUP is not returned by sockets
* 2009: [https://svnweb.freebsd.org/base?view=revision&revision=195423 FreeBSD r195423 adds POLLHUP for sockets]
* 2009: [https://svnweb.freebsd.org/base?view=revision&revision=195423 FreeBSD adds POLLHUP for sockets]
* 2009: [https://svnweb.freebsd.org/base?view=revision&revision=196460 FreeBSD r196460 improves poll conformance for sockets] by returning POLLHUP more often instead of POLLIN
* 2009: f2159cc7908d0
* 2009: [https://svnweb.freebsd.org/base?view=revision&revision=196556 FreeBSD r196556 fixes POLLHUP on half-closed sockets] by only returning POLLHUP on fully closed sockets and returning POLLIN on empty buffers
* 2009: 74d1c4927a3b7ce785e41e97e33a804f4f8c62ce
* 2018: ad7eb8cad5320


== OpenBSD ==
== OpenBSD ==
Line 143: Line 144:


* POLLIN if checking
* POLLIN if checking
* POLLHUP always, even when checking for no events
* POLLHUP always


This is regardless of whether there is data in the socket to read.
This is regardless of whether there is data in the socket to read.
Please note that all contributions to JookWiki are considered to be released under the Creative Commons Zero (Public Domain) (see JookWiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)