Skip to content

Commit

Permalink
add safety comment to exec/poll
Browse files Browse the repository at this point in the history
  • Loading branch information
squell committed Sep 3, 2024
1 parent 7547389 commit 502fca4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/exec/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,9 @@ impl<T: Process> EventRegistry<T> {
return Ok(ids);
}

// SAFETY: `poll` expects a pointer to an array of file descriptors (first argument),
// the length of which is indicated by the second argument; the third argument being -1
// denotes an infinite timeout.
// FIXME: we should set either a timeout or use ppoll when available.
cerr(unsafe { libc::poll(fds.as_mut_ptr(), fds.len() as _, -1) })?;

Expand Down

0 comments on commit 502fca4

Please sign in to comment.