Software / code / prosody
Comparison
util-src/poll.c @ 12884:f5a75aaa8a25
util.poll: Include unistd.h only for epoll
This defines close(), which is only used with epoll, hence we don't need
to include it when building in poll or select mode.
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Fri, 10 Feb 2023 00:37:05 +0100 |
| parent | 12575:1f6f05a98fcd |
| child | 12976:a187600ec7d6 |
comparison
equal
deleted
inserted
replaced
| 12883:0d5868a9e641 | 12884:f5a75aaa8a25 |
|---|---|
| 6 * This project is MIT licensed. Please see the | 6 * This project is MIT licensed. Please see the |
| 7 * COPYING file in the source package for more information. | 7 * COPYING file in the source package for more information. |
| 8 * | 8 * |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 #include <unistd.h> | |
| 12 #include <string.h> | 11 #include <string.h> |
| 13 #include <errno.h> | 12 #include <errno.h> |
| 14 | 13 |
| 15 #if defined(__linux__) | 14 #if defined(__linux__) |
| 16 #define USE_EPOLL | 15 #define USE_EPOLL |
| 22 #define USE_SELECT | 21 #define USE_SELECT |
| 23 #define POLL_BACKEND "select" | 22 #define POLL_BACKEND "select" |
| 24 #endif | 23 #endif |
| 25 | 24 |
| 26 #ifdef USE_EPOLL | 25 #ifdef USE_EPOLL |
| 26 #include <unistd.h> | |
| 27 #include <sys/epoll.h> | 27 #include <sys/epoll.h> |
| 28 #ifndef MAX_EVENTS | 28 #ifndef MAX_EVENTS |
| 29 #define MAX_EVENTS 64 | 29 #define MAX_EVENTS 64 |
| 30 #endif | 30 #endif |
| 31 #endif | 31 #endif |