This manual page is for Mac OS X version 10.6

If you are running a different version of Mac OS X, view the documentation locally:

  • In Terminal, using the man(1) command

Reading manual pages

Manual pages are intended as a quick reference for people who already understand a technology.

  • For more information about the manual page format, see the manual page for manpages(5).

  • For more information about this technology, look for other documentation in the Apple Reference Library.

  • For general information about writing shell scripts, read Shell Scripting Primer.



POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE(3)    BSD Library Functions Manual    POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE(3)

NAME
     posix_spawn_file_actions_addclose posix_spawn_file_actions_addopen -- add open or close actions to a
     posix_spawn_file_actions_t

SYNOPSIS
     #include <spawn.h>

     int
     posix_spawn_file_actions_addclose(posix_spawn_file_actions_t *file_actions, int filedes);

     int
     posix_spawn_file_actions_addopen(posix_spawn_file_actions_t *restrict file_actions, int filedes,
         const char *restrict path, int oflag, mode_t mode);

     int
     posix_spawn_file_actions_adddup2(posix_spawn_file_actions_t *file_actions, int filedes,
         int newfiledes);

DESCRIPTION
     The posix_spawn_file_actions_addclose() function adds a close operation to the list of operations asso-ciated associated
     ciated with the object referenced by file_actions, for subsequent use in a call to posix_spawn(2) or
     posix_spawnp(2).  The descriptor referred to by filedes is closed as if close() had been called on it
     prior to the new child process starting execution.

     The posix_spawn_file_actions_addopen() function adds an open operation to the list of operations asso-ciated associated
     ciated with the object referenced by file_actions, for subsequent use in a call to posix_spawn(2) or
     posix_spawnp(2).  The descriptor referred to by filedes is opened using the path, oflag, and mode argu-ments arguments
     ments as if open() had been called on it prior to the new child process starting execution.  The string
     path is copied by the posix_spawn_file_actions_addopen() function during this process, so storage need
     not be persistent in the caller.

     The posix_spawn_file_actions_adddup2() function adds a dup2 operation to the list of operations associ-ated associated
     ated with the object referenced by file_actions, for subsequent use in a call to posix_spawn(2) or
     posix_spawnp(2).  The descriptor referred to by newfiledes is created as if dup2() had been called on
     filedes prior to the new child process starting execution.

RETURN VALUES
     On success, these functions return 0; on failure they return an error number from <errno.h>.

ERRORS
     These functions may fail if:

     [EBADF]            The value specified by filedes is negative or would cause the process to exceed the
                        maximum number of open files it is allowed..

     [EINVAL]           The value of file_actions is invalid.

     [ENOMEM]           Insufficient memory was available eo add to the file_actions.

SEE ALSO
     posix_spawn(2), posix_spawnp(2), posix_spawn_file_actions_init(3), posix_spawn_file_actions_destroy(3),

STANDARDS
     Version 3 of the Single UNIX Specification (``SUSv3'') [SPN]

HISTORY
     The posix_spawn_file_actions_init() and posix_spawn_file_actions_destroy() function calls appeared in
     Version 3 of the Single UNIX Specification (``SUSv3'') [SPN].

Mac OS X                                       August 22, 2007                                      Mac OS X

Reporting Problems

The way to report a problem with this manual page depends on the type of problem:

Content errors
Report errors in the content of this documentation with the feedback links below.
Bug reports
Report bugs in the functionality of the described tool or API through Bug Reporter.
Formatting problems
Report formatting mistakes in the online version of these pages with the feedback links below.