The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ 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  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-2  -  FREEBSD-11-1  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-4  -  FREEBSD-10-3  -  FREEBSD-10-2  -  FREEBSD-10-1  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-3  -  FREEBSD-9-2  -  FREEBSD-9-1  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-4  -  FREEBSD-8-3  -  FREEBSD-8-2  -  FREEBSD-8-1  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-4  -  FREEBSD-7-3  -  FREEBSD-7-2  -  FREEBSD-7-1  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-4  -  FREEBSD-6-3  -  FREEBSD-6-2  -  FREEBSD-6-1  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-5  -  FREEBSD-5-4  -  FREEBSD-5-3  -  FREEBSD-5-2  -  FREEBSD-5-1  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  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 
SearchContext: -  none  -  3  -  10 

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

Cache object: 93ceaa41e7ecc6d38a454522119df96a


[ 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.