aboutsummaryrefslogtreecommitdiffstats
path: root/erts
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2018-03-29 15:26:04 +0200
committerLukas Larsson <[email protected]>2018-03-29 15:26:08 +0200
commitf46d38dcca5ebd17e32068e0cb0cb9802c6b07a8 (patch)
tree7296a0eec2b861a33a5e676f4908dd4f71aeb1cc /erts
parent0083a9451f5770a38bb21e78b7d574e5b72ba5f3 (diff)
downloadotp-f46d38dcca5ebd17e32068e0cb0cb9802c6b07a8.tar.gz
otp-f46d38dcca5ebd17e32068e0cb0cb9802c6b07a8.tar.bz2
otp-f46d38dcca5ebd17e32068e0cb0cb9802c6b07a8.zip
erts: Don't use EV_DISPATCH on openbsd
Currently (OpenBSD 6.2) the kqueu implementation on opnebsd does not work properly for EOF conditions when using EV_DISPATCH, so we use the EV_ONESHOT fallback there.
Diffstat (limited to 'erts')
-rw-r--r--erts/emulator/sys/common/erl_poll.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/erts/emulator/sys/common/erl_poll.c b/erts/emulator/sys/common/erl_poll.c
index 7aa53e8f36..ced8a4a2a7 100644
--- a/erts/emulator/sys/common/erl_poll.c
+++ b/erts/emulator/sys/common/erl_poll.c
@@ -782,10 +782,14 @@ update_pollset(ErtsPollSet *ps, int fd, ErtsPollOp op, ErtsPollEvents events)
struct kevent evts[2];
struct timespec ts = {0, 0};
-#ifdef EV_DISPATCH
- /* If we have EV_DISPATCH we use it. The kevent descriptions for both
- read and write are added on OP_ADD and removed on OP_DEL. And then
- after than only EV_ENABLE|EV_DISPATCH are used.
+#if defined(EV_DISPATCH) && !defined(__OpenBSD__)
+ /* If we have EV_DISPATCH we use it, unless we are on OpenBSD as the
+ behavior of EV_EOF seems to be edge triggered there and we need it
+ to be level triggered.
+
+ The kevent descriptions for both read and write are added on OP_ADD
+ and removed on OP_DEL. And then after than only EV_ENABLE|EV_DISPATCH
+ are used.
It could be possible to not modify the pollset when disabling and/or
deleting events, but that may cause the poll threads to be awoken