summaryrefslogtreecommitdiff
path: root/include/ruby/io.h
diff options
context:
space:
mode:
authorYuta Saito <kateinoigakukun@gmail.com>2021-12-15 15:49:59 +0900
committerYuta Saito <kateinoigakukun@gmail.com>2022-01-19 11:19:06 +0900
commit50f1468bfd11eb2ea54c2d6bea958f44eb2db33c (patch)
treedd97b1fb42e1558d912660c1b8cb7b8b625017a8 /include/ruby/io.h
parent4f579ecfcee2dc230bd7f744c6db8f8d8d902ad8 (diff)
[wasm] include/ruby/io.h: define RB_WAITFD_PRI by ourselves for wasi
RB_WAITFD_PRI uses POLLPRI for other platforms, but wasi-libc doesn't have POLLPRI for now.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/5407
Diffstat (limited to 'include/ruby/io.h')
-rw-r--r--include/ruby/io.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/ruby/io.h b/include/ruby/io.h
index 3e035c114d..6ecf405366 100644
--- a/include/ruby/io.h
+++ b/include/ruby/io.h
@@ -35,7 +35,12 @@
# undef revents
# endif
# define RB_WAITFD_IN POLLIN
-# define RB_WAITFD_PRI POLLPRI
+# if defined(__wasi__) && !defined(POLLPRI)
+// wasi-libc doesn't have POLLPRI and 0x002 is already reserved for POLLOUT, so use 0x003
+# define RB_WAITFD_PRI 0x003
+# else
+# define RB_WAITFD_PRI POLLPRI
+# endif
# define RB_WAITFD_OUT POLLOUT
#else
# define RB_WAITFD_IN 0x001