Spec-Zone .ru
спецификации, руководства, описания, API
Spec-Zone .ru
спецификации, руководства, описания, API
Библиотека разработчика Mac Разработчик
Поиск

 

Эта страница руководства является частью версии 5.0 Инструментов XCode

Получить эти инструменты:

Если Вы выполняете версию Инструментов XCode кроме 5,0, просматриваете документацию локально:

Читать страницы руководства

Страницы руководства предназначаются как справочник для людей, уже понимающих технологию.

  • Чтобы изучить, как руководство организовано или узнать о синтаксисе команды, прочитайте страницу руководства для страниц справочника (5).

  • Для получения дополнительной информации об этой технологии, ищите другую документацию в Библиотеке Разработчика Apple.

  • Для получения общей информации о записи сценариев оболочки, считайте Shell, Пишущий сценарий Учебника для начинающих.




POSIX_SPAWN_FILE_ACTI... BSD Library Functions Manual POSIX_SPAWN_FILE_ACTI...

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);

     int
     posix_spawn_file_actions_addinherit_np(posix_spawn_file_actions_t *file_actions, int filedes);

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.

     The posix_spawn_file_actions_addinherit_np() function adds an abstract inheritance operation to the
     list of operations associated with the object referenced by file_actions, for subsequent use in a call
     to posix_spawn(2) or posix_spawnp(2).  The pre-existing descriptor referred to by filedes is marked for
     inheritance into the new process image, and the FD_CLOEXEC flag is cleared from the file descriptor in
     the new process image.

     Normally, for posix_spawn(2) and posix_spawnp(2), all file descriptors are inherited from the parent
     process into the spawned process, except for those explicitly marked as close-on-exec.  However if the
     flag POSIX_SPAWN_CLOEXEC_DEFAULT is set, then during the spawn operation, all pre-existing file
     descriptors in the parent process are treated as if they had been marked close-on-exec i.e. none of
     them are automatically inherited.  See posix_spawnattr_setflags(3).  Only file descriptors explicitly
     manipulated via file_actions are made available in the spawned process. In that case,
     posix_spawn_file_actions_addinherit_np() can be used to make specific pre-existing file descriptors
     from the parent process be available in the spawned process.

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 to add the new action to file_actions.

SEE ALSO
     posix_spawn(2), posix_spawnp(2), posix_spawn_file_actions_init(3), posix_spawn_file_actions_destroy(3),
     posix_spawnattr_setflags(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                       November 2, 2010                       Mac OS X

Сообщение о проблемах

Способ сообщить о проблеме с этой страницей руководства зависит от типа проблемы:

Ошибки содержания
Ошибки отчета в содержании этой документации со ссылками на отзыв ниже.
Отчеты об ошибках
Сообщите об ошибках в функциональности описанного инструмента или API через Генератор отчетов Ошибки.
Форматирование проблем
Отчет, форматирующий ошибки в интерактивной версии этих страниц со ссылками на отзыв ниже.