diff options
author | Yuta Saito <kateinoigakukun@gmail.com> | 2021-12-15 15:49:59 +0900 |
---|---|---|
committer | Yuta Saito <kateinoigakukun@gmail.com> | 2022-01-19 11:19:06 +0900 |
commit | 50f1468bfd11eb2ea54c2d6bea958f44eb2db33c (patch) | |
tree | dd97b1fb42e1558d912660c1b8cb7b8b625017a8 /include/ruby | |
parent | 4f579ecfcee2dc230bd7f744c6db8f8d8d902ad8 (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')
-rw-r--r-- | include/ruby/io.h | 7 |
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 |