aboutsummaryrefslogtreecommitdiff
path: root/src/microhttpd/internal.h
diff options
context:
space:
mode:
authorEvgeny Grin (Karlson2k) <k2k@narod.ru>2023-11-01 13:36:43 +0300
committerEvgeny Grin (Karlson2k) <k2k@narod.ru>2023-11-01 13:51:53 +0300
commit75e2addd08c4e73873d8e3511accb25a01e7e4d8 (patch)
tree5fdd322465bb79e9eb531c455a2a9fe54918af47 /src/microhttpd/internal.h
parent5f8e3c9b93d13553a4e0d9df406091888a05dc7c (diff)
downloadlibmicrohttpd-75e2addd08c4e73873d8e3511accb25a01e7e4d8.tar.gz
libmicrohttpd-75e2addd08c4e73873d8e3511accb25a01e7e4d8.zip
internal.h: added macros for polling mode detection
Diffstat (limited to 'src/microhttpd/internal.h')
-rw-r--r--src/microhttpd/internal.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/src/microhttpd/internal.h b/src/microhttpd/internal.h
index e9020cf9..adcc43da 100644
--- a/src/microhttpd/internal.h
+++ b/src/microhttpd/internal.h
@@ -149,6 +149,61 @@
149#endif /* ! MHD_STATICSTR_LEN_ */ 149#endif /* ! MHD_STATICSTR_LEN_ */
150 150
151 151
152#if defined(HAVE_POLL) && defined(EPOLL_SUPPORT)
153/**
154 * Checks whether the @a d daemon is using select()
155 */
156#define MHD_D_USING_SELECT_(d) \
157 (0 == (d->options & (MHD_USE_POLL | MHD_USE_EPOLL)))
158/**
159 * Checks whether the @a d daemon is using poll()
160 */
161#define MHD_D_USING_POLL_(d) (0 != (d->options & MHD_USE_POLL))
162/**
163 * Checks whether the @a d daemon is using epoll
164 */
165#define MHD_D_USING_EPOLL_(d) (0 != (d->options & MHD_USE_EPOLL))
166#elif defined(HAVE_POLL)
167/**
168 * Checks whether the @a d daemon is using select()
169 */
170#define MHD_D_USING_SELECT_(d) (0 == (d->options & MHD_USE_POLL))
171/**
172 * Checks whether the @a d daemon is using poll()
173 */
174#define MHD_D_USING_POLL_(d) (0 != (d->options & MHD_USE_POLL))
175/**
176 * Checks whether the @a d daemon is using epoll
177 */
178#define MHD_D_USING_EPOLL_(d) (0)
179#elif defined(EPOLL_SUPPORT)
180/**
181 * Checks whether the @a d daemon is using select()
182 */
183#define MHD_D_USING_SELECT_(d) (0 == (d->options & MHD_USE_EPOLL))
184/**
185 * Checks whether the @a d daemon is using poll()
186 */
187#define MHD_D_USING_POLL_(d) (0)
188/**
189 * Checks whether the @a d daemon is using epoll
190 */
191#define MHD_D_USING_EPOLL_(d) (0 != (d->options & MHD_USE_EPOLL))
192#else /* select() only */
193/**
194 * Checks whether the @a d daemon is using select()
195 */
196#define MHD_D_USING_SELECT_(d) (! 0)
197/**
198 * Checks whether the @a d daemon is using poll()
199 */
200#define MHD_D_USING_POLL_(d) (0)
201/**
202 * Checks whether the @a d daemon is using epoll
203 */
204#define MHD_D_USING_EPOLL_(d) (0)
205#endif /* select() only */
206
152/** 207/**
153 * Tri-state on/off/unknown 208 * Tri-state on/off/unknown
154 */ 209 */