Compose foreground sandbox process lifetimes
This commit is contained in:
parent
3171c41399
commit
fd78804fc7
1 changed files with 2313 additions and 7 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue