aboutsummaryrefslogtreecommitdiff
path: root/src/common/compat_libevent.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/compat_libevent.c')
-rw-r--r--src/common/compat_libevent.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/common/compat_libevent.c b/src/common/compat_libevent.c
index d3b9eb3afa..7bbad54415 100644
--- a/src/common/compat_libevent.c
+++ b/src/common/compat_libevent.c
@@ -186,6 +186,12 @@ tor_libevent_initialize(tor_libevent_cfg *torcfg)
event_config_set_num_cpus_hint(cfg, torcfg->num_cpus);
#endif
+#if LIBEVENT_VERSION_NUMBER >= V(2,0,9)
+ /* We can enable changelist support with epoll, since we don't give
+ * Libevent any dup'd fds. This lets us avoid some syscalls. */
+ event_config_set_flag(cfg, EVENT_BASE_FLAG_EPOLL_USE_CHANGELIST);
+#endif
+
the_event_base = event_base_new_with_config(cfg);
event_config_free(cfg);