11b5d61b8Smrg/* 21b5d61b8Smrg * Copyright © 2016 Keith Packard 31b5d61b8Smrg * 41b5d61b8Smrg * Permission to use, copy, modify, distribute, and sell this software and its 51b5d61b8Smrg * documentation for any purpose is hereby granted without fee, provided that 61b5d61b8Smrg * the above copyright notice appear in all copies and that both that copyright 71b5d61b8Smrg * notice and this permission notice appear in supporting documentation, and 81b5d61b8Smrg * that the name of the copyright holders not be used in advertising or 91b5d61b8Smrg * publicity pertaining to distribution of the software without specific, 101b5d61b8Smrg * written prior permission. The copyright holders make no representations 111b5d61b8Smrg * about the suitability of this software for any purpose. It is provided "as 121b5d61b8Smrg * is" without express or implied warranty. 131b5d61b8Smrg * 141b5d61b8Smrg * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 151b5d61b8Smrg * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO 161b5d61b8Smrg * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR 171b5d61b8Smrg * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, 181b5d61b8Smrg * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 191b5d61b8Smrg * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 201b5d61b8Smrg * OF THIS SOFTWARE. 211b5d61b8Smrg */ 221b5d61b8Smrg 231b5d61b8Smrg#ifndef _XSERVER_POLL_H_ 241b5d61b8Smrg#define _XSERVER_POLL_H_ 251b5d61b8Smrg 261b5d61b8Smrg#ifndef _DIX_CONFIG_H_ 27497507cfSmrg#error must include dix-config.h to use xserver_poll.h 281b5d61b8Smrg#endif 291b5d61b8Smrg 301b5d61b8Smrg#ifdef HAVE_POLL 311b5d61b8Smrg#include <poll.h> 321b5d61b8Smrg#define xserver_poll(fds, nfds, timeout) poll(fds, nfds, timeout) 331b5d61b8Smrg#else 341b5d61b8Smrg 351b5d61b8Smrg#define POLLIN 0x01 361b5d61b8Smrg#define POLLPRI 0x02 371b5d61b8Smrg#define POLLOUT 0x04 381b5d61b8Smrg#define POLLERR 0x08 391b5d61b8Smrg#define POLLHUP 0x10 401b5d61b8Smrg#define POLLNVAL 0x20 411b5d61b8Smrg 421b5d61b8Smrgstruct pollfd 431b5d61b8Smrg{ 441b5d61b8Smrg int fd; 451b5d61b8Smrg short events; 461b5d61b8Smrg short revents; 471b5d61b8Smrg}; 481b5d61b8Smrg 491b5d61b8Smrgtypedef unsigned long nfds_t; 501b5d61b8Smrg 511b5d61b8Smrgint xserver_poll (struct pollfd *pArray, nfds_t n_fds, int timeout); 521b5d61b8Smrg 531b5d61b8Smrg#endif 541b5d61b8Smrg 551b5d61b8Smrg#endif /* _XSERVER_POLL_H_ */ 56