Struct nix::spawn::PosixSpawnFileActions
source · pub struct PosixSpawnFileActions { /* private fields */ }
Expand description
A spawn file actions object. See posix_spawn_file_actions_t.
Implementations§
source§impl PosixSpawnFileActions
impl PosixSpawnFileActions
sourcepub fn init() -> Result<PosixSpawnFileActions>
pub fn init() -> Result<PosixSpawnFileActions>
Initialize the spawn file actions object. See posix_spawn_file_actions_init.
sourcepub fn reinit(self) -> Result<PosixSpawnFileActions>
pub fn reinit(self) -> Result<PosixSpawnFileActions>
Reinitialize the spawn file actions object. This is a wrapper around posix_spawn_file_actions_destroy. followed by posix_spawn_file_actions_init.
sourcepub fn add_dup2(&mut self, fd: RawFd, newfd: RawFd) -> Result<()>
pub fn add_dup2(&mut self, fd: RawFd, newfd: RawFd) -> Result<()>
Add a dup2 action. See posix_spawn_file_actions_adddup2.
sourcepub fn add_open<P: ?Sized + NixPath>(
&mut self,
fd: RawFd,
path: &P,
oflag: OFlag,
mode: Mode,
) -> Result<()>
pub fn add_open<P: ?Sized + NixPath>( &mut self, fd: RawFd, path: &P, oflag: OFlag, mode: Mode, ) -> Result<()>
Add an open action. See posix_spawn_file_actions_addopen.
sourcepub fn add_close(&mut self, fd: RawFd) -> Result<()>
pub fn add_close(&mut self, fd: RawFd) -> Result<()>
Add a close action. See posix_spawn_file_actions_addclose.
sourcepub fn add_chdir<P: ?Sized + NixPath>(&mut self, path: &P) -> Result<()>
pub fn add_chdir<P: ?Sized + NixPath>(&mut self, path: &P) -> Result<()>
Add a chdir action. See posix_spawn_file_actions_addchdir.
sourcepub fn add_fchdir(&mut self, fd: RawFd) -> Result<()>
pub fn add_fchdir(&mut self, fd: RawFd) -> Result<()>
Add an fchdir action. See posix_spawn_file_actions_addfchdir.
sourcepub fn add_closefrom_np(&mut self, fd: RawFd) -> Result<()>
pub fn add_closefrom_np(&mut self, fd: RawFd) -> Result<()>
Add a closefrom action.
The action closes all file descriptors with a value greater or equal to fd
during spawn.
sourcepub fn add_tcsetpgrp_np(&mut self, tc_fd: RawFd) -> Result<()>
pub fn add_tcsetpgrp_np(&mut self, tc_fd: RawFd) -> Result<()>
Add a tcsetpgrp action.
This action sets the process group of the foreground process group associated with the
terminal tc_fd
.