From 502fca4df76314f88c6e4915c7dfc2117390b057 Mon Sep 17 00:00:00 2001 From: Marc Schoolderman Date: Tue, 3 Sep 2024 01:28:26 +0200 Subject: [PATCH] add safety comment to exec/poll --- src/exec/event.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/exec/event.rs b/src/exec/event.rs index e5707fecb..6f186812d 100644 --- a/src/exec/event.rs +++ b/src/exec/event.rs @@ -178,6 +178,9 @@ impl EventRegistry { 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) })?;