unix::init: Handle ENOSYS from poll on Unikraft.

Signed-off-by: Martin Kröning <martin.kroening@eonerc.rwth-aachen.de>
This commit is contained in:
Martin Kröning 2023-07-05 12:49:35 +02:00 committed by Martin Kröning
parent 2b8a284d78
commit 7485e9c965
Failed to extract signature

View file

@ -110,6 +110,11 @@ unsafe fn sanitize_standard_fds() {
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