[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/sys/poll.h

Version: -  FREEBSD  -  FREEBSD10  -  FREEBSD9  -  FREEBSD92  -  FREEBSD91  -  FREEBSD90  -  FREEBSD8  -  FREEBSD82  -  FREEBSD81  -  FREEBSD80  -  FREEBSD7  -  FREEBSD74  -  FREEBSD73  -  FREEBSD72  -  FREEBSD71  -  FREEBSD70  -  FREEBSD6  -  FREEBSD64  -  FREEBSD63  -  FREEBSD62  -  FREEBSD61  -  FREEBSD60  -  FREEBSD5  -  FREEBSD55  -  FREEBSD54  -  FREEBSD53  -  FREEBSD52  -  FREEBSD51  -  FREEBSD50  -  FREEBSD4  -  FREEBSD3  -  FREEBSD22  -  cheribsd  -  linux-2.6  -  linux-2.4.22  -  MK83  -  MK84  -  PLAN9  -  DFBSD  -  NETBSD  -  NETBSD5  -  NETBSD4  -  NETBSD3  -  NETBSD20  -  OPENBSD  -  xnu-517  -  xnu-792  -  xnu-792.6.70  -  xnu-1228  -  xnu-1456.1.26  -  xnu-1699.24.8  -  xnu-2050.18.24  -  OPENSOLARIS  -  minix-3-1-1  -  FREEBSD-LIBC  -  FREEBSD8-LIBC  -  FREEBSD7-LIBC  -  FREEBSD6-LIBC  -  GLIBC27 
SearchContext: -  none  -  3  -  10 

    1 /*-
    2  * Copyright (c) 1997 Peter Wemm <peter@freebsd.org>
    3  * All rights reserved.
    4  *
    5  * Redistribution and use in source and binary forms, with or without
    6  * modification, are permitted provided that the following conditions
    7  * are met:
    8  * 1. Redistributions of source code must retain the above copyright
    9  *    notice, this list of conditions and the following disclaimer.
   10  * 2. Redistributions in binary form must reproduce the above copyright
   11  *    notice, this list of conditions and the following disclaimer in the
   12  *    documentation and/or other materials provided with the distribution.
   13  * 3. The name of the author may not be used to endorse or promote products
   14  *    derived from this software without specific prior written permission.
   15  *
   16  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
   17  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   18  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   19  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
   20  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   21  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   22  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   23  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   24  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   25  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   26  * SUCH DAMAGE.
   27  *
   28  * $FreeBSD: stable/9/sys/sys/poll.h 99710 2002-07-10 04:47:25Z mike $
   29  */
   30 
   31 #ifndef _SYS_POLL_H_
   32 #define _SYS_POLL_H_
   33 
   34 #include <sys/cdefs.h>
   35 
   36 /*
   37  * This file is intended to be compatible with the traditional poll.h.
   38  */
   39 
   40 typedef unsigned int    nfds_t;
   41 
   42 /*
   43  * This structure is passed as an array to poll(2).
   44  */
   45 struct pollfd {
   46         int     fd;             /* which file descriptor to poll */
   47         short   events;         /* events we are interested in */
   48         short   revents;        /* events found on return */
   49 };
   50 
   51 /*
   52  * Requestable events.  If poll(2) finds any of these set, they are
   53  * copied to revents on return.
   54  * XXX Note that FreeBSD doesn't make much distinction between POLLPRI
   55  * and POLLRDBAND since none of the file types have distinct priority
   56  * bands - and only some have an urgent "mode".
   57  * XXX Note POLLIN isn't really supported in true SVSV terms.  Under SYSV
   58  * POLLIN includes all of normal, band and urgent data.  Most poll handlers
   59  * on FreeBSD only treat it as "normal" data.
   60  */
   61 #define POLLIN          0x0001          /* any readable data available */
   62 #define POLLPRI         0x0002          /* OOB/Urgent readable data */
   63 #define POLLOUT         0x0004          /* file descriptor is writeable */
   64 #define POLLRDNORM      0x0040          /* non-OOB/URG data available */
   65 #define POLLWRNORM      POLLOUT         /* no write type differentiation */
   66 #define POLLRDBAND      0x0080          /* OOB/Urgent readable data */
   67 #define POLLWRBAND      0x0100          /* OOB/Urgent data can be written */
   68 
   69 #if __BSD_VISIBLE
   70 /* General FreeBSD extension (currently only supported for sockets): */
   71 #define POLLINIGNEOF    0x2000          /* like POLLIN, except ignore EOF */
   72 #endif
   73 
   74 /*
   75  * These events are set if they occur regardless of whether they were
   76  * requested.
   77  */
   78 #define POLLERR         0x0008          /* some poll error occurred */
   79 #define POLLHUP         0x0010          /* file descriptor was "hung up" */
   80 #define POLLNVAL        0x0020          /* requested events "invalid" */
   81 
   82 #if __BSD_VISIBLE
   83 
   84 #define POLLSTANDARD    (POLLIN|POLLPRI|POLLOUT|POLLRDNORM|POLLRDBAND|\
   85                          POLLWRBAND|POLLERR|POLLHUP|POLLNVAL)
   86 
   87 /*
   88  * Request that poll() wait forever.
   89  * XXX in SYSV, this is defined in stropts.h, which is not included
   90  * by poll.h.
   91  */
   92 #define INFTIM          (-1)
   93 
   94 #endif
   95 
   96 #ifndef _KERNEL
   97 
   98 __BEGIN_DECLS
   99 int     poll(struct pollfd _pfd[], nfds_t _nfds, int _timeout);
  100 __END_DECLS
  101 
  102 #endif /* !_KERNEL */
  103 
  104 #endif /* !_SYS_POLL_H_ */

Cache object: 5bf730345b2dd71e31498bc57e478759


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.