Skip to content

Commit

Permalink
lib: wasm: core/iwasm: posix.c: fix POLL{RD,WR}NORM in uClibc
Browse files Browse the repository at this point in the history
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: bytecodealliance/wasm-micro-runtime#2069

Signed-off-by: Thomas Devoogdt <thomas.devoogdt@barco.com>
  • Loading branch information
ThomasDevoogdt committed Apr 29, 2023
1 parent 6629bf0 commit 24d4503
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 24d4503

Please sign in to comment.