diff options
| author | Martin Kröning <mkroening@posteo.net> | 2023-07-05 12:49:35 +0200 |
|---|---|---|
| committer | Martin Kröning <martin.kroening@eonerc.rwth-aachen.de> | 2023-07-24 18:25:30 +0200 |
| commit | 7485e9c9652c8add0a10302b4a4076148f3b626c (patch) | |
| tree | 9c6cd8e883578795d233e552c782547da5d9dd49 /library/std/src/sys/unix/mod.rs | |
| parent | 2b8a284d78b40da55733d56f3229274aaa6f9716 (diff) | |
| download | rust-7485e9c9652c8add0a10302b4a4076148f3b626c.tar.gz rust-7485e9c9652c8add0a10302b4a4076148f3b626c.zip | |
`unix::init`: Handle `ENOSYS` from `poll` on Unikraft.
Signed-off-by: Martin Kröning <martin.kroening@eonerc.rwth-aachen.de>
Diffstat (limited to 'library/std/src/sys/unix/mod.rs')
| -rw-r--r-- | library/std/src/sys/unix/mod.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/library/std/src/sys/unix/mod.rs b/library/std/src/sys/unix/mod.rs index 326f1481e19..9d52f414574 100644 --- a/library/std/src/sys/unix/mod.rs +++ b/library/std/src/sys/unix/mod.rs @@ -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 |
