Destroys and initializes a spawn file actions object.
#include <spawn.h>
int posix_spawn_file_actions_destroy(posix_spawn_file_actions_t *
file_actions);
int posix_spawn_file_actions_init(posix_spawn_file_actions_t *
file_actions);
The posix_spawn_file_actions_destroy subroutine destroys the object referenced by file_actions; the object becomes, in effect, uninitialized. An implementation can cause posix_spawn_file_actions_destroy to set the object referenced by file_actions to an invalid value. A destroyed spawn file actions object can be reinitialized using posix_spawn_file_actions_init; the results of otherwise referencing the object after it has been destroyed are undefined.
The posix_spawn_file_actions_init function initializes the object referenced by file_actions to contain no file actions for posix_spawn or posix_spawnp to perform.
A spawn file actions object is as defined in posix_spawn_file_actions_addclose. The effect of initializing a previously initialized spawn file actions object is undefined.
Upon successful completion, the posix_spawn_file_actions_destroy and posix_spawn_file_actions_init subroutines return 0; otherwise, an error number is returned to indicate the error.
Item | Description |
---|---|
ENOMEM | Insufficient memory exists to initialize the spawn file actions object. |
Item | Description |
---|---|
EINVAL | The value specified by file_actions is invalid. |