Skip to content

Commit

Permalink
unix::init: Handle ENOSYS from poll on Unikraft.
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Kröning <[email protected]>
  • Loading branch information
mkroening committed Jul 24, 2023
1 parent 2b8a284 commit 7485e9c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions library/std/src/sys/unix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ pub unsafe fn init(argc: isize, argv: *const *const u8, sigpipe: u8) {
while libc::poll(pfds.as_mut_ptr(), 3, 0) == -1 {
match errno() {
libc::EINTR => continue,
#[cfg(target_vendor = "unikraft")]
libc::ENOSYS => {
// Not all configurations of Unikraft enable `LIBPOSIX_EVENT`.
break 'poll;
}
libc::EINVAL | libc::EAGAIN | libc::ENOMEM => {
// RLIMIT_NOFILE or temporary allocation failures
// may be preventing use of poll(), fall back to fcntl
Expand Down

0 comments on commit 7485e9c

Please sign in to comment.