From 57ac991ebf739ca1c5401ce86514cba49c2149aa Mon Sep 17 00:00:00 2001 From: Thomas Devoogdt Date: Tue, 25 Apr 2023 14:06:12 +0200 Subject: [PATCH] lib: wasm: core/iwasm: posix.c: fix POLL{RD,WR}NORM in uClibc Not defined in uClibc, so replace them with the equivalent POLL{OUT,IN}. https://www.man7.org/linux/man-pages/man2/poll.2.html POLLWRNORM Equivalent to POLLOUT. POLLRDNORM Equivalent to POLLIN. upstream: https://github.com/bytecodealliance/wasm-micro-runtime/pull/2069 Signed-off-by: Thomas Devoogdt --- .../libc-wasi/sandboxed-system-primitives/src/posix.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/wasm-micro-runtime-WAMR-1.1.1/core/iwasm/libraries/libc-wasi/sandboxed-system-primitives/src/posix.c b/lib/wasm-micro-runtime-WAMR-1.1.1/core/iwasm/libraries/libc-wasi/sandboxed-system-primitives/src/posix.c index e43ba8ce043..b0e92c3a842 100644 --- a/lib/wasm-micro-runtime-WAMR-1.1.1/core/iwasm/libraries/libc-wasi/sandboxed-system-primitives/src/posix.c +++ b/lib/wasm-micro-runtime-WAMR-1.1.1/core/iwasm/libraries/libc-wasi/sandboxed-system-primitives/src/posix.c @@ -2644,8 +2644,8 @@ wasmtime_ssp_poll_oneoff( pfds[i] = (struct pollfd){ .fd = fd_number(fos[i]), .events = s->u.type == __WASI_EVENTTYPE_FD_READ - ? POLLRDNORM - : POLLWRNORM, + ? POLLIN + : POLLOUT, }; } else { @@ -2756,7 +2756,7 @@ wasmtime_ssp_poll_oneoff( __WASI_EVENT_FD_READWRITE_HANGUP, }; } - else if ((pfds[i].revents & (POLLRDNORM | POLLWRNORM)) != 0) { + else if ((pfds[i].revents & (POLLIN | POLLOUT)) != 0) { // Read or write possible. out[(*nevents)++] = (__wasi_event_t){ .userdata = in[i].userdata,