Skip to content

Commit 7485e9c

Browse files
committed
unix::init: Handle ENOSYS from poll on Unikraft.
Signed-off-by: Martin Kröning <[email protected]>
1 parent 2b8a284 commit 7485e9c

File tree

1 file changed

+5
-0
lines changed
  • library/std/src/sys/unix

1 file changed

+5
-0
lines changed

library/std/src/sys/unix/mod.rs

+5
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,11 @@ pub unsafe fn init(argc: isize, argv: *const *const u8, sigpipe: u8) {
110110
while libc::poll(pfds.as_mut_ptr(), 3, 0) == -1 {
111111
match errno() {
112112
libc::EINTR => continue,
113+
#[cfg(target_vendor = "unikraft")]
114+
libc::ENOSYS => {
115+
// Not all configurations of Unikraft enable `LIBPOSIX_EVENT`.
116+
break 'poll;
117+
}
113118
libc::EINVAL | libc::EAGAIN | libc::ENOMEM => {
114119
// RLIMIT_NOFILE or temporary allocation failures
115120
// may be preventing use of poll(), fall back to fcntl

0 commit comments

Comments
 (0)