17 #ifndef APR_ARCH_POLL_PRIVATE_H
18 #define APR_ARCH_POLL_PRIVATE_H
26 #ifdef HAVE_PORT_CREATE
28 #include <sys/port_impl.h>
32 #include <sys/types.h>
33 #include <sys/event.h>
38 #include <sys/epoll.h>
42 #define HAS_SOCKETS(dt) (dt == APR_POLL_SOCKET) ? 1 : 0
43 #define HAS_PIPES(dt) (dt == APR_POLL_FILE) ? 1 : 0
46 #if defined(HAVE_AIO_H) && defined(HAVE_AIO_MSGQ)
53 #define POLLSET_USES_KQUEUE
54 #define POLLSET_DEFAULT_METHOD APR_POLLSET_KQUEUE
55 #elif defined(HAVE_PORT_CREATE)
56 #define POLLSET_USES_PORT
57 #define POLLSET_DEFAULT_METHOD APR_POLLSET_PORT
58 #elif defined(HAVE_EPOLL)
59 #define POLLSET_USES_EPOLL
60 #define POLLSET_DEFAULT_METHOD APR_POLLSET_EPOLL
61 #elif defined(HAVE_AIO_MSGQ)
62 #define POLLSET_USES_AIO_MSGQ
63 #define POLLSET_DEFAULT_METHOD APR_POLLSET_AIO_MSGQ
64 #elif defined(HAVE_POLL)
65 #define POLLSET_USES_POLL
66 #define POLLSET_DEFAULT_METHOD APR_POLLSET_POLL
68 #define POLLSET_USES_SELECT
69 #define POLLSET_DEFAULT_METHOD APR_POLLSET_SELECT
73 #define POLL_USES_SELECT
74 #undef POLLSET_DEFAULT_METHOD
75 #define POLLSET_DEFAULT_METHOD APR_POLLSET_SELECT
78 #define POLL_USES_POLL
80 #define POLL_USES_SELECT
85 #define WAKEUP_USES_PIPE 0
87 #define WAKEUP_USES_PIPE 1
90 #if defined(POLLSET_USES_KQUEUE) || defined(POLLSET_USES_EPOLL) || defined(POLLSET_USES_PORT) || defined(POLLSET_USES_AIO_MSGQ)
96 #define pollset_lock_rings() \
97 if (pollset->flags & APR_POLLSET_THREADSAFE) \
98 apr_thread_mutex_lock(pollset->p->ring_lock);
99 #define pollset_unlock_rings() \
100 if (pollset->flags & APR_POLLSET_THREADSAFE) \
101 apr_thread_mutex_unlock(pollset->p->ring_lock);
103 #define pollset_lock_rings()
104 #define pollset_unlock_rings()
107 typedef struct pfd_elem_t pfd_elem_t;
112 #ifdef HAVE_PORT_CREATE
142 #if defined(HAVE_EPOLL)
143 struct epoll_event *epoll;
145 #if defined(HAVE_PORT_CREATE)
148 #if defined(HAVE_KQUEUE)
151 #if defined(HAVE_POLL)
apr_status_t apr_poll_create_wakeup_pipe(apr_pool_t *pool, apr_pollfd_t *pfd, apr_file_t **wakeup_pipe)
struct apr_pollset_private_t apr_pollset_private_t
Definition: apr_arch_poll_private.h:119
void apr_poll_drain_wakeup_pipe(volatile apr_uint32_t *wakeup_set, apr_file_t **wakeup_pipe)
apr_status_t apr_poll_close_wakeup_pipe(apr_file_t **wakeup_pipe)
APR Thread Mutex Routines.
apr_bucket_brigade request_rec apr_pool_t * pool
Definition: mod_dav.h:557
int apr_status_t
Definition: apr_errno.h:44
apr_status_t(* apr_pollcb_cb_t)(void *baton, apr_pollfd_t *descriptor)
Definition: apr_poll.h:402
struct apr_pool_t apr_pool_t
Definition: apr_pools.h:60
#define APR_RING_ENTRY(elem)
Definition: apr_ring.h:70
apr_int64_t apr_interval_time_t
Definition: apr_time.h:55
Definition: apr_arch_file_io.h:107
Definition: apr_arch_poll_private.h:185
apr_status_t(* remove)(apr_pollcb_t *, apr_pollfd_t *)
Definition: apr_arch_poll_private.h:188
apr_status_t(* create)(apr_pollcb_t *, apr_uint32_t, apr_pool_t *, apr_uint32_t)
Definition: apr_arch_poll_private.h:186
apr_status_t(* poll)(apr_pollcb_t *, apr_interval_time_t, apr_pollcb_cb_t, void *)
Definition: apr_arch_poll_private.h:189
apr_status_t(* cleanup)(apr_pollcb_t *)
Definition: apr_arch_poll_private.h:190
const char * name
Definition: apr_arch_poll_private.h:191
apr_status_t(* add)(apr_pollcb_t *, apr_pollfd_t *)
Definition: apr_arch_poll_private.h:187
Definition: apr_arch_poll_private.h:157
apr_uint32_t flags
Definition: apr_arch_poll_private.h:161
volatile apr_uint32_t wakeup_set
Definition: apr_arch_poll_private.h:169
apr_file_t * wakeup_pipe[2]
Definition: apr_arch_poll_private.h:164
int fd
Definition: apr_arch_poll_private.h:170
apr_pollfd_t wakeup_pfd
Definition: apr_arch_poll_private.h:168
const apr_pollcb_provider_t * provider
Definition: apr_arch_poll_private.h:173
apr_pollcb_pset pollset
Definition: apr_arch_poll_private.h:171
apr_uint32_t nalloc
Definition: apr_arch_poll_private.h:160
apr_pool_t * pool
Definition: apr_arch_poll_private.h:158
apr_uint32_t nelts
Definition: apr_arch_poll_private.h:159
apr_pollfd_t ** copyset
Definition: apr_arch_poll_private.h:172
Definition: apr_poll.h:109
Definition: apr_arch_poll_private.h:176
apr_status_t(* add)(apr_pollset_t *, const apr_pollfd_t *)
Definition: apr_arch_poll_private.h:178
apr_status_t(* poll)(apr_pollset_t *, apr_interval_time_t, apr_int32_t *, const apr_pollfd_t **)
Definition: apr_arch_poll_private.h:180
const char * name
Definition: apr_arch_poll_private.h:182
apr_status_t(* cleanup)(apr_pollset_t *)
Definition: apr_arch_poll_private.h:181
apr_status_t(* remove)(apr_pollset_t *, const apr_pollfd_t *)
Definition: apr_arch_poll_private.h:179
apr_status_t(* create)(apr_pollset_t *, apr_uint32_t, apr_pool_t *, apr_uint32_t)
Definition: apr_arch_poll_private.h:177
Definition: apr_arch_poll_private.h:124
apr_uint32_t nalloc
Definition: apr_arch_poll_private.h:127
apr_file_t * wakeup_pipe[2]
Definition: apr_arch_poll_private.h:131
const apr_pollset_provider_t * provider
Definition: apr_arch_poll_private.h:138
apr_pollset_private_t * p
Definition: apr_arch_poll_private.h:137
apr_uint32_t flags
Definition: apr_arch_poll_private.h:128
apr_pool_t * pool
Definition: apr_arch_poll_private.h:125
apr_pollfd_t wakeup_pfd
Definition: apr_arch_poll_private.h:135
volatile apr_uint32_t wakeup_set
Definition: apr_arch_poll_private.h:136
apr_uint32_t nelts
Definition: apr_arch_poll_private.h:126
Definition: apr_arch_networkio.h:37
Definition: apr_arch_poll_private.h:141
void * undef
Definition: apr_arch_poll_private.h:154