POSIX_SPAWN_FILE_ACTIONS_INIT(3) | Library Functions Manual | POSIX_SPAWN_FILE_ACTIONS_INIT(3)

# NAME

`posix_spawn_file_actions_init`, `posix_spawn_file_actions_destroy` — create and destroy posix_spawn file actions objects

# SYNOPSIS

`#include <spawn.h>`

int
`posix_spawn_file_actions_init`(posix_spawn_file_actions_t *file_actions);

int
`posix_spawn_file_actions_destroy`(posix_spawn_file_actions_t *file_actions);

# DESCRIPTION

File actions objects can be initialized by `posix_spawn_file_actions_init`() and destroyed by `posix_spawn_file_actions_destroy`().

Multiple initialization of the same object is undefined behavior and will lead to memory leaks.

Similarly, objects should be passed to `posix_spawn_file_actions_destroy`() to reclaim memory. The object should not be re-used after destruction. It can however be initialized again with `posix_spawn_file_actions_init`().

# RETURN VALUES

These function return 0 on successful completion. They may return `ENOMEM` when running out of memory.

# SEE ALSO

posix_spawn(3), posix_spawn_file_actions_addopen(3)

# STANDARDS

Both functions conform to IEEE Std 1003.1-2001 (“POSIX.1”).

# AUTHORS

Ed Schouten <ed@FreeBSD.org>

November 30, 2014 | Debian