Lines Matching +full:hall +full:- +full:switch +full:-
1 /*---------------------------------------------------------------------------*\
6 poll - select(2)-based poll() emulation function for BSD systems.
28 of select() -- which is how this function is implemented.
31 Stevens, W. Richard. Unix Network Programming. Prentice-Hall, 1990.
39 http://opensource.org/licenses/bsd-license.php
41 Copyright (c) 1995-2011, Brian M. Clapper
69 \*---------------------------------------------------------------------------*/
72 /*---------------------------------------------------------------------------*\
74 \*---------------------------------------------------------------------------*/
77 #include <dix-config.h>
87 /*---------------------------------------------------------------------------*\
89 \*---------------------------------------------------------------------------*/
95 /*---------------------------------------------------------------------------*\
97 \*---------------------------------------------------------------------------*/
108 register int max_fd = -1; /* return value */ in map_poll_spec()
118 if (pCur->fd < 0) in map_poll_spec()
121 if (pCur->events & POLLIN) in map_poll_spec()
124 FD_SET (pCur->fd, pReadSet); in map_poll_spec()
127 if (pCur->events & POLLOUT) in map_poll_spec()
130 FD_SET (pCur->fd, pWriteSet); in map_poll_spec()
133 if (pCur->events & POLLPRI) in map_poll_spec()
139 FD_SET (pCur->fd, pExceptSet); in map_poll_spec()
142 max_fd = MAX (max_fd, pCur->fd); in map_poll_spec()
159 -1 wait indefinitely (until signal occurs) in map_timeout()
170 switch (poll_timeout) in map_timeout()
172 case -1: in map_timeout()
184 pSelTimeout->tv_sec = 0; in map_timeout()
185 pSelTimeout->tv_usec = 0; in map_timeout()
191 pSelTimeout->tv_sec = poll_timeout / 1000; /* get seconds */ in map_timeout()
193 pSelTimeout->tv_usec = poll_timeout * 1000; /* get microseconds */ in map_timeout()
216 if (pCur->fd < 0) in map_select_results()
221 pCur->revents = 0; in map_select_results()
222 if (FD_ISSET (pCur->fd, pExceptSet)) in map_select_results()
223 pCur->revents |= POLLPRI; in map_select_results()
225 else if (FD_ISSET (pCur->fd, pReadSet)) in map_select_results()
226 pCur->revents |= POLLIN; in map_select_results()
228 if (FD_ISSET (pCur->fd, pWriteSet)) in map_select_results()
229 pCur->revents |= POLLOUT; in map_select_results()
235 /*---------------------------------------------------------------------------*\
237 \*---------------------------------------------------------------------------*/