Просмотр исходного кода

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>
Thomas Devoogdt 2 лет назад
Родитель
Сommit
61369d48fd

+ 3 - 3
core/iwasm/libraries/libc-wasi/sandboxed-system-primitives/src/posix.c

@@ -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,