1 | #ifndef _system_select_h
|
---|
2 | #define _system_select_h
|
---|
3 | /*
|
---|
4 | Unix SMB/CIFS implementation.
|
---|
5 |
|
---|
6 | select system include wrappers
|
---|
7 |
|
---|
8 | Copyright (C) Andrew Tridgell 2004
|
---|
9 |
|
---|
10 | ** NOTE! The following LGPL license applies to the replace
|
---|
11 | ** library. This does NOT imply that all of Samba is released
|
---|
12 | ** under the LGPL
|
---|
13 |
|
---|
14 | This library is free software; you can redistribute it and/or
|
---|
15 | modify it under the terms of the GNU Lesser General Public
|
---|
16 | License as published by the Free Software Foundation; either
|
---|
17 | version 3 of the License, or (at your option) any later version.
|
---|
18 |
|
---|
19 | This library is distributed in the hope that it will be useful,
|
---|
20 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
21 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
22 | Lesser General Public License for more details.
|
---|
23 |
|
---|
24 | You should have received a copy of the GNU Lesser General Public
|
---|
25 | License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
---|
26 |
|
---|
27 | */
|
---|
28 |
|
---|
29 | #ifdef HAVE_SYS_SELECT_H
|
---|
30 | #include <sys/select.h>
|
---|
31 | #endif
|
---|
32 |
|
---|
33 | #ifdef HAVE_SYS_EPOLL_H
|
---|
34 | #include <sys/epoll.h>
|
---|
35 | #endif
|
---|
36 |
|
---|
37 | #ifdef HAVE_SOLARIS_PORTS
|
---|
38 | #include <port.h>
|
---|
39 | #endif
|
---|
40 |
|
---|
41 | #ifndef SELECT_CAST
|
---|
42 | #define SELECT_CAST
|
---|
43 | #endif
|
---|
44 |
|
---|
45 | #ifdef HAVE_POLL
|
---|
46 |
|
---|
47 | #include <poll.h>
|
---|
48 |
|
---|
49 | #else
|
---|
50 |
|
---|
51 | /* Type used for the number of file descriptors. */
|
---|
52 | typedef unsigned long int nfds_t;
|
---|
53 |
|
---|
54 | /* Data structure describing a polling request. */
|
---|
55 | struct pollfd
|
---|
56 | {
|
---|
57 | int fd; /* File descriptor to poll. */
|
---|
58 | short int events; /* Types of events poller cares about. */
|
---|
59 | short int revents; /* Types of events that actually occurred. */
|
---|
60 | };
|
---|
61 |
|
---|
62 | /* Event types that can be polled for. These bits may be set in `events'
|
---|
63 | to indicate the interesting event types; they will appear in `revents'
|
---|
64 | to indicate the status of the file descriptor. */
|
---|
65 | #define POLLIN 0x001 /* There is data to read. */
|
---|
66 | #define POLLPRI 0x002 /* There is urgent data to read. */
|
---|
67 | #define POLLOUT 0x004 /* Writing now will not block. */
|
---|
68 | #define POLLRDNORM 0x040 /* Normal data may be read. */
|
---|
69 | #define POLLRDBAND 0x080 /* Priority data may be read. */
|
---|
70 | #define POLLWRNORM 0x100 /* Writing now will not block. */
|
---|
71 | #define POLLWRBAND 0x200 /* Priority data may be written. */
|
---|
72 | #define POLLERR 0x008 /* Error condition. */
|
---|
73 | #define POLLHUP 0x010 /* Hung up. */
|
---|
74 | #define POLLNVAL 0x020 /* Invalid polling request. */
|
---|
75 |
|
---|
76 | /* define is in "replace.h" */
|
---|
77 | int rep_poll(struct pollfd *fds, nfds_t nfds, int timeout);
|
---|
78 |
|
---|
79 | #endif
|
---|
80 |
|
---|
81 | #endif
|
---|