aboutsummaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authorThomas Munro <tmunro@FreeBSD.org>2021-04-28 09:31:38 +0000
committerThomas Munro <tmunro@FreeBSD.org>2021-04-28 11:00:31 +0000
commit3aaaa2efde896e19d229ee2cf09fe7e6ab0fbf6e (patch)
tree9c01cefa11d2ad1e7c4361db4956a524a671cc92 /lib/libc
parent01a856c666194b77a359eaf2b27ee6a4f9d9945b (diff)
downloadsrc-3aaaa2efde896e19d229ee2cf09fe7e6ab0fbf6e.tar.gz
src-3aaaa2efde896e19d229ee2cf09fe7e6ab0fbf6e.zip
poll(2): Add POLLRDHUP.
Teach poll(2) to support Linux-style POLLRDHUP events for sockets, if requested. Triggered when the remote peer shuts down writing or closes its end. Reviewed by: kib MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D29757
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/sys/poll.214
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/libc/sys/poll.2 b/lib/libc/sys/poll.2
index bea4aac82bd3..fec82db08944 100644
--- a/lib/libc/sys/poll.2
+++ b/lib/libc/sys/poll.2
@@ -28,7 +28,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd February 27, 2019
+.Dd April 27, 2021
.Dt POLL 2
.Os
.Sh NAME
@@ -126,6 +126,15 @@ POLLOUT
should never be present in the
.Fa revents
bitmask at the same time.
+.It POLLRDHUP
+Remote peer closed connection, or shut down writing.
+Unlike
+POLLHUP,
+POLLRDHUP
+must be present in the
+.Fa events
+bitmask to be reported.
+Applies only to stream sockets.
.It POLLNVAL
The file descriptor is not open,
or in capability mode the file descriptor has insufficient rights.
@@ -261,6 +270,9 @@ function conforms to
The
.Fn ppoll
is not specified by POSIX.
+The
+POLLRDHUP
+flag is not specified by POSIX, but is compatible with Linux and illumos.
.Sh HISTORY
The
.Fn poll