From 8270e0b330dfe638dc1b7e40f62600b249cb492b Mon Sep 17 00:00:00 2001 From: Sascha Wildner Date: Sun, 25 May 2008 14:04:32 +0000 Subject: [PATCH] Perform some mdoc cleanup. --- lib/libc/sys/poll.2 | 92 ++++++++++++++++++++++++++++++----------------------- 1 file changed, 53 insertions(+), 39 deletions(-) diff --git a/lib/libc/sys/poll.2 b/lib/libc/sys/poll.2 index 173dedd5c1..420b55b591 100644 --- a/lib/libc/sys/poll.2 +++ b/lib/libc/sys/poll.2 @@ -1,6 +1,6 @@ .\" $NetBSD: poll.2,v 1.3 1996/09/07 21:53:08 mycroft Exp $ .\" $FreeBSD: src/lib/libc/sys/poll.2,v 1.4.2.3 2001/12/14 18:34:01 ru Exp $ -.\" $DragonFly: src/lib/libc/sys/poll.2,v 1.6 2008/01/12 06:01:26 nant Exp $ +.\" $DragonFly: src/lib/libc/sys/poll.2,v 1.7 2008/05/25 14:04:32 swildner Exp $ .\" .\" Copyright (c) 1996 Charles M. Hannum. All rights reserved. .\" @@ -50,7 +50,8 @@ The .Fa fds argument is a pointer to an array of pollfd structures as defined in .In poll.h -(shown below). The +(shown below). +The .Fa nfds argument determines the size of the .Fa fds @@ -66,15 +67,18 @@ struct pollfd { The fields of .Fa struct pollfd are as follows: -.Bl -tag -width XXXrevents -.It fd -File descriptor to poll. If fd is equal to -1 then +.Bl -tag -offset indent -width ".Fa revents" +.It Fa fd +File descriptor to poll. +If fd is equal to -1 then .Fa revents is cleared (set to zero), and that pollfd is not checked. -.It events -Events to poll for. (See below.) -.It revents -Events which may occur. (See below.) +.It Fa events +Events to poll for. +(See below.) +.It Fa revents +Events which may occur. +(See below.) .El .Pp The event bitmasks in @@ -82,49 +86,56 @@ The event bitmasks in and .Fa revents have the following bits: -.Bl -tag -width XXXPOLLWRNORM -.It POLLIN +.Bl -tag -offset indent -width ".Dv POLLRDNORM" +.It Dv POLLIN Data other than high priority data may be read without blocking. -.It POLLRDNORM +.It Dv POLLRDNORM Normal data may be read without blocking. -.It POLLRDBAND +.It Dv POLLRDBAND Data with a non-zero priority may be read without blocking. -.It POLLPRI +.It Dv POLLPRI High priority data may be read without blocking. -.It POLLOUT -.It POLLWRNORM +.It Dv POLLOUT +.It Dv POLLWRNORM Normal data may be written without blocking. -.It POLLWRBAND +.It Dv POLLWRBAND Data with a non-zero priority may be written without blocking. -.It POLLERR -An exceptional condition has occurred on the device or socket. This -flag is always checked, even if not present in the +.It Dv POLLERR +An exceptional condition has occurred on the device or socket. +This flag is always checked, even if not present in the .Fa events bitmask. -.It POLLHUP -The device or socket has been disconnected. This flag is always -checked, even if not present in the +.It Dv POLLHUP +The device or socket has been disconnected. +This flag is always checked, even if not present in the .Fa events -bitmask. Note that -POLLHUP +bitmask. +Note that +.Dv POLLHUP and -POLLOUT +.Dv POLLOUT should never be present in the .Fa revents bitmask at the same time. -.It POLLNVAL -The file descriptor is not open. This flag is always checked, even -if not present in the +.It Dv POLLNVAL +The file descriptor is not open. +This flag is always checked, even if not present in the .Fa events bitmask. .El .Pp If .Fa timeout -is neither zero nor INFTIM (-1), it specifies a maximum interval to -wait for any file descriptor to become ready, in milliseconds. If +is neither zero nor +.Dv INFTIM Pq -1 , +it specifies a maximum interval to +wait for any file descriptor to become ready, in milliseconds. +If .Fa timeout -is INFTIM (-1), the poll blocks indefinitely. If +is +.Dv INFTIM Pq -1 , +the poll blocks indefinitely. +If .Fa timeout is zero, then .Fn poll @@ -132,7 +143,8 @@ will return without blocking. .Sh RETURN VALUES .Fn Poll returns the number of descriptors that are ready for I/O, or -1 if an -error occurred. If the time limit expires, +error occurred. +If the time limit expires, .Fn poll returns 0. If @@ -146,15 +158,17 @@ array will be unmodified. This implementation differs from the historical one in that a given file descriptor may not cause .Fn poll -to return with an error. In cases where this would have happened in -the historical implementation (e.g. trying to poll a +to return with an error. +In cases where this would have happened in the historical implementation +(e.g.\& trying to poll a .Xr revoke 2 Ns ed descriptor), this implementation instead copies the .Fa events bitmask to the .Fa revents -bitmask. Attempting to perform I/O on this descriptor will then -return an error. This behaviour is believed to be more useful. +bitmask. +Attempting to perform I/O on this descriptor will then return an error. +This behaviour is believed to be more useful. .Sh ERRORS An error return from .Fn poll @@ -189,5 +203,5 @@ The distinction between some of the fields in the .Fa events and .Fa revents -bitmasks is really not useful without STREAMS. The fields are -defined for compatibility with existing software. +bitmasks is really not useful without STREAMS. +The fields are defined for compatibility with existing software. -- 2.11.4.GIT