|POSIX_SPAWN_FILE_ACTIONS_ADDOPEN(3)||Library Functions Manual||POSIX_SPAWN_FILE_ACTIONS_ADDOPEN(3)|
add action to close, dup2 or open file descriptor to file
fildes, const char
*restrict path, int
Actions are executed in order in the child process:
posix_spawn_file_actions_addclose() function adds an action that causes
to be called.
posix_spawn_file_actions_adddup2() function adds an action that causes
to be called. In addition, the action will cause the close-on-exec flag to be cleared on newfildes, even if newfildes equals fildes.
posix_spawn_file_actions_addopen() adds an action that causes
open(path, oflag, mode);
to be called and the result to be forced as fildes (if fildes was already open before this action, the old file descriptor is closed before the action is performed).
posix_spawn_file_actions_addopen() makes a copy
of the path argument.
Upon successful completion, these functions return zero. Otherwise
they may return
EINVAL for negative file
ENOMEM if they run out of
These functions conform to IEEE Std 1003.1-2001 (“POSIX.1”).
Ed Schouten <ed@FreeBSD.org>
|November 30, 2014||OpenBSD-current|