Compose foreground sandbox process lifetimes

This commit is contained in:
ms2k 2026-07-15 19:09:24 +09:00
commit fd78804fc7

View file

@ -14,6 +14,18 @@ pub fn private_seqpacket_pair() -> std::io::Result<(OwnedFd, OwnedFd)> {
.map_err(Into::into)
}
/// # Errors
/// Returns an error when the private stream pair cannot be created.
pub fn private_stream_pair() -> std::io::Result<(OwnedFd, OwnedFd)> {
socketpair(
AddressFamily::UNIX,
SocketType::STREAM,
SocketFlags::CLOEXEC,
None,
)
.map_err(Into::into)
}
#[cfg(test)]
mod tests {
use std::os::fd::AsFd;