Print this page
11641 spelling mistakes in section 7d of the manual

Split Close
Expand all
Collapse all
          --- old/usr/src/man/man7d/poll.7d
          +++ new/usr/src/man/man7d/poll.7d
   1    1  '\" te
   2    2  .\" Copyright (c) 2007 Sun Microsystems, Inc.  All Rights Reserved.
   3    3  .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
   4    4  .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
   5    5  .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
   6      -.TH POLL 7D "April 9, 2016"
        6 +.TH POLL 7D "January 10, 2020"
   7    7  .SH NAME
   8    8  poll \- driver for fast poll on many file descriptors
   9    9  .SH SYNOPSIS
  10      -.LP
  11   10  .nf
  12   11  \fB#include <sys/devpoll.h>
  13   12  int fd = open("/dev/poll", O_RDWR);
  14   13  ssize_t n = write(int fd, struct pollfd buf[], int bufsize);
  15   14  int n = ioctl(int fd, DP_POLL, struct dvpoll* arg);
  16   15  int n = ioctl(int fd, DP_ISPOLLED, struct pollfd* pfd);\fR
  17   16  .fi
  18   17  
  19   18  .SH PARAMETERS
  20   19  .ne 2
↓ open down ↓ 43 lines elided ↑ open up ↑
  64   63  .sp
  65   64  .ne 2
  66   65  .na
  67   66  \fB\fIpfd\fR \fR
  68   67  .ad
  69   68  .RS 12n
  70   69  Pointer to \fBpollfd\fR structure.
  71   70  .RE
  72   71  
  73   72  .SH DESCRIPTION
  74      -.LP
  75   73  The  \fB/dev/poll\fR driver is a special driver that enables you to monitor
  76   74  multiple sets  of polled file descriptors. By using the  \fB/dev/poll\fR
  77   75  driver, you can efficiently poll large numbers of file descriptors. Access to
  78   76  the \fB/dev/poll\fR driver is provided through \fBopen\fR(2), \fBwrite\fR(2),
  79   77  and  \fBioctl(2)\fR system calls.
  80   78  .sp
  81   79  .LP
  82   80  Writing an array of  \fBpollfd\fR struct to the  \fB/dev/poll\fR driver has the
  83   81  effect of  adding these file descriptors to the monitored \fBpoll\fR file
  84   82  descriptor set  represented by the \fIfd\fR. To monitor multiple file
↓ open down ↓ 48 lines elided ↑ open up ↑
 133  131  on any of the polled file descriptors, the \fBDP_POLL\fR ioctl call will wait
 134  132  \fBdp_timeout\fR milliseconds before returning. If \fBdp_timeout\fR is
 135  133  \fB0\fR, the ioctl call returns immediately. If \fBdp_timeout\fR is \fB-1\fR,
 136  134  the call blocks until an interested \fBpoll\fR \fBevents\fR is available or the
 137  135  call is interrupted. Upon return, if the ioctl call has failed, \fB-1\fR is
 138  136  returned. The memory content pointed by \fBdp_fds\fR is not modified. A return
 139  137  value \fB0\fR means the ioctl is timed out. In this case, the memory content
 140  138  pointed by  \fBdp_fds\fR is not modified. If the call is successful, it returns
 141  139  the number of valid \fBpollfd\fR entries in  the array pointed by \fBdp_fds\fR;
 142  140  the contents of the rest of the buffer is undefined. For each valid
 143      -\fBpollfd\fR entry, the \fBfd\fR field indicates the file desciptor on which
      141 +\fBpollfd\fR entry, the \fBfd\fR field indicates the file descriptor on which
 144  142  the polled \fBevents\fR happened. The  \fBevents\fR field is the user specified
 145  143  \fBpoll\fR \fBevents\fR. The \fBrevents\fR field contains the  \fBevents\fR
 146  144  occurred. \fB-1\fR is returned if the  call fails.
 147  145  .sp
 148  146  .LP
 149  147  \fBDP_ISPOLLED\fR ioctl allows you to query if a file descriptor is already in
 150  148  the  monitored set represented by  \fBfd\fR. The \fBfd\fR field of the
 151  149  \fBpollfd\fR structure indicates the file descriptor of interest. The
 152  150  \fBDP_ISPOLLED\fR ioctl returns  \fB1\fR if the file descriptor is in the set.
 153  151  The \fBevents\fR field contains  \fB0\fR. The \fBrevents\fR field contains the
 154  152  currently polled \fBevents\fR. The ioctl returns  \fB0\fR if the file
 155  153  descriptor is not in the set. The  \fBpollfd\fR structure pointed by  \fIpfd\fR
 156  154  is not modified. The ioctl returns a  \fB-1\fR if the call fails.
 157  155  .SH EXAMPLES
 158      -.LP
 159  156  The following example shows how  \fB/dev/poll\fR may be used.
 160  157  .sp
 161  158  .in +2
 162  159  .nf
 163  160  {
 164  161          ...
 165  162          /*
 166  163           * open the driver
 167  164           */
 168  165          if ((wfd = open("/dev/poll", O_RDWR)) < 0) {
↓ open down ↓ 159 lines elided ↑ open up ↑
 328  325  \fB\fBENXIO\fR \fR
 329  326  .ad
 330  327  .RS 11n
 331  328  The \fBO_NONBLOCK\fR flag is set, the named file is a FIFO, the \fBO_WRONLY\fR
 332  329  flag is set, and no process has the file open for reading; or the named file is
 333  330  a character special or block special file and the device associated with this
 334  331  special file does not exist.
 335  332  .RE
 336  333  
 337  334  .SH ATTRIBUTES
 338      -.LP
 339  335  See \fBattributes\fR(5) for a description of the following attributes:
 340  336  .sp
 341  337  
 342  338  .sp
 343  339  .TS
 344  340  box;
 345  341  l l
 346  342  l l .
 347  343  ATTRIBUTE TYPE  ATTRIBUTE VALUE
 348  344  Architecture    SPARC, x86
 349  345  Interface Stability     Obsolete
 350  346  MT-Level        Safe
 351  347  .TE
 352  348  
 353  349  .SH SEE ALSO
 354      -.LP
 355  350  \fBopen\fR(2), \fBpoll\fR(2), \fBwrite\fR(2), \fBattributes\fR(5)
 356  351  .SH NOTES
 357      -.LP
 358  352  The \fB/dev/poll\fR API is particularly beneficial to applications that poll a
 359  353  large number of file descriptors repeatedly.  Applications will exhibit the
 360  354  best performance gain if the polled file descriptor list rarely change.
 361  355  .sp
 362  356  .LP
 363  357  When using the \fB/dev/poll\fR driver, you should remove a closed file
 364  358  descriptor from a monitored poll set. Failure to do so may result in a
 365  359  \fBPOLLNVAL\fR \fBrevents\fR being returned for the closed file descriptor.
 366  360  When a file descriptor is closed but not removed from the monitored set, and is
 367  361  reused in subsequent open of a different device, you will be polling the device
↓ open down ↓ 18 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX