subprocess::posix_util::posix_spawn_file_actions class

A RAII wrapper over posix_spawn_file_actions_t.

posix_spawn_file_actions_t is used by the POSIX system call posix_spawnp to decide what to do with the file descriptors after a child process is spawned.

Any actions added to the object are performed sequentially in the child. If any action is invalid or leads to an os_error, posix_spawnp errors out.

This class manages the lifetime of the posix_spawn_file_actions_t objects so that it is difficult for the user to leak memory. It also exports some helper functions to add actions to the encapsulated posix_spawn_file_actions_t struct.

Constructors, destructors, conversion operators

posix_spawn_file_actions(const posix_spawn_file_actions&) defaulted
posix_spawn_file_actions(posix_spawn_file_actions&&) defaulted noexcept

Public functions

auto operator=(const posix_spawn_file_actions&) -> posix_spawn_file_actions& defaulted
auto operator=(posix_spawn_file_actions&&) -> posix_spawn_file_actions& defaulted noexcept
void dup(const descriptor_ptr& fd_from, standard_filenos fd_to)
void close(const descriptor_ptr& fd)
auto get() -> posix_spawn_file_actions_t*