Add a close a file descriptor action to a spawn file actions object
#include <spawn.h> int posix_spawn_file_actions_addclose( posix_spawn_file_actions_t *fact_p, int fd);
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The posix_spawn_file_actions_addclose() function adds a close action to a spawn file actions object (the object referenced by fact_p) that causes the file descriptor fd to be closed (as if close(fd) had been called) when a new process is spawned using this file actions object.
It isn't considered an error if the fd argument specifies a file descriptor for which the specified operation could not be performed at the time of the call. Any such error will be detected when the associated file actions object is later used during a posix_spawn() or posix_spawnp() operation.
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | Yes |
Signal handler | Yes |
Thread | Yes |