libc-wasi/posix.c: Fix POLL{RD,WR}NORM in uClibc (#2069)

POLLRDNORM/POLLWRNORM may be not defined in uClibc, so replace them
with the equivalent POLLIN/POLLOUT.

Refer to https://www.man7.org/linux/man-pages/man2/poll.2.html
  POLLRDNORM Equivalent to POLLIN
  POLLWRNORM Equivalent to POLLOUT

Signed-off-by: Thomas Devoogdt <thomas.devoogdt@barco.com>
This commit is contained in:
Thomas Devoogdt 2023-03-28 05:20:31 +02:00 committed by GitHub
parent d0fb2716b6
commit 61369d48fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2655,8 +2655,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 {
@ -2767,7 +2767,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,