![]() |
posix-next API 0.1.0
Out-of-tree Zephyr POSIX module
|
POSIX Spawn option. More...
Files | |
| file | spawn.h |
| POSIX process spawning (<spawn.h>) | |
Data Structures | |
| struct | posix_spawnattr_t |
| Spawn attributes object, initialized with posix_spawnattr_init(). More... | |
| struct | posix_spawn_file_actions_t |
| Ordered list of file actions performed in the child, initialized with posix_spawn_file_actions_init(). More... | |
Macros | |
| #define | POSIX_SPAWN_RESETIDS 0x01 |
| Reset the child's effective user and group IDs to its real IDs. | |
| #define | POSIX_SPAWN_SETPGROUP 0x02 |
| Place the child in the process group named by the pgroup attribute. | |
| #define | POSIX_SPAWN_SETSCHEDPARAM 0x04 |
| Set the child's scheduling parameters from the schedparam attribute. | |
| #define | POSIX_SPAWN_SETSCHEDULER 0x08 |
| Set the child's scheduling policy from the schedpolicy attribute. | |
| #define | POSIX_SPAWN_SETSIGDEF 0x10 |
| Reset the signals named by the sigdefault attribute to their default actions. | |
| #define | POSIX_SPAWN_SETSIGMASK 0x20 |
| Set the child's signal mask from the sigmask attribute. | |
Functions | |
| int | posix_spawn (pid_t *pid, const char *path, const posix_spawn_file_actions_t *file_actions, const posix_spawnattr_t *attrp, char *const argv[], char *const envp[]) |
Spawn a new process from the executable image named by path. | |
| int | posix_spawnp (pid_t *pid, const char *file, const posix_spawn_file_actions_t *file_actions, const posix_spawnattr_t *attrp, char *const argv[], char *const envp[]) |
Spawn a new process, resolving file as posix_spawn() resolves a path. | |
| int | posix_spawn_file_actions_addclose (posix_spawn_file_actions_t *file_actions, int fildes) |
Add a close action for descriptor fildes in the child. | |
| int | posix_spawn_file_actions_adddup2 (posix_spawn_file_actions_t *file_actions, int fildes, int newfildes) |
Add a dup2 action in the child, duplicating fildes onto newfildes. | |
| int | posix_spawn_file_actions_addopen (posix_spawn_file_actions_t *file_actions, int fildes, const char *path, int oflag, mode_t mode) |
Add an open action in the child, opening path as descriptor fildes. | |
| int | posix_spawn_file_actions_destroy (posix_spawn_file_actions_t *file_actions) |
| Destroy a file actions object. | |
| int | posix_spawn_file_actions_init (posix_spawn_file_actions_t *file_actions) |
| Initialize a file actions object with no actions. | |
| int | posix_spawnattr_destroy (posix_spawnattr_t *attr) |
| Destroy a spawn attributes object. | |
| int | posix_spawnattr_getflags (const posix_spawnattr_t *attr, short *flags) |
| Get the POSIX_SPAWN_* flags of a spawn attributes object. | |
| int | posix_spawnattr_getpgroup (const posix_spawnattr_t *attr, pid_t *pgroup) |
| Get the process group attribute. | |
| int | posix_spawnattr_getschedparam (const posix_spawnattr_t *attr, struct sched_param *schedparam) |
| Get the scheduling parameter attribute. | |
| int | posix_spawnattr_getschedpolicy (const posix_spawnattr_t *attr, int *schedpolicy) |
| Get the scheduling policy attribute. | |
| int | posix_spawnattr_getsigdefault (const posix_spawnattr_t *attr, sigset_t *sigdefault) |
| Get the default-signals attribute. | |
| int | posix_spawnattr_getsigmask (const posix_spawnattr_t *attr, sigset_t *sigmask) |
| Get the signal mask attribute. | |
| int | posix_spawnattr_init (posix_spawnattr_t *attr) |
| Initialize a spawn attributes object with default values. | |
| int | posix_spawnattr_setflags (posix_spawnattr_t *attr, short flags) |
| Set the POSIX_SPAWN_* flags of a spawn attributes object. | |
| int | posix_spawnattr_setpgroup (posix_spawnattr_t *attr, pid_t pgroup) |
| Set the process group attribute, applied with POSIX_SPAWN_SETPGROUP. | |
| int | posix_spawnattr_setschedparam (posix_spawnattr_t *attr, const struct sched_param *schedparam) |
| Set the scheduling parameter attribute, applied with POSIX_SPAWN_SETSCHEDPARAM. | |
| int | posix_spawnattr_setschedpolicy (posix_spawnattr_t *attr, int schedpolicy) |
| Set the scheduling policy attribute, applied with POSIX_SPAWN_SETSCHEDULER. | |
| int | posix_spawnattr_setsigdefault (posix_spawnattr_t *attr, const sigset_t *sigdefault) |
| Set the default-signals attribute, applied with POSIX_SPAWN_SETSIGDEF. | |
| int | posix_spawnattr_setsigmask (posix_spawnattr_t *attr, const sigset_t *sigmask) |
| Set the signal mask attribute, applied with POSIX_SPAWN_SETSIGMASK. | |
POSIX Spawn option.
| #define POSIX_SPAWN_RESETIDS 0x01 |
| #define POSIX_SPAWN_SETPGROUP 0x02 |
| #define POSIX_SPAWN_SETSCHEDPARAM 0x04 |
| #define POSIX_SPAWN_SETSCHEDULER 0x08 |
| #define POSIX_SPAWN_SETSIGDEF 0x10 |
| #define POSIX_SPAWN_SETSIGMASK 0x20 |
| int posix_spawn | ( | pid_t * | pid, |
| const char * | path, | ||
| const posix_spawn_file_actions_t * | file_actions, | ||
| const posix_spawnattr_t * | attrp, | ||
| char *const | argv[], | ||
| char *const | envp[] | ||
| ) |
Spawn a new process from the executable image named by path.
File actions and attributes are applied in the child, in that order, before the child begins execution.
| pid | Output: process ID of the child, or NULL. |
| path | Path naming the executable image. |
| file_actions | File actions performed in the child, or NULL. |
| attrp | Spawn attributes, or NULL for defaults. |
| argv | NULL-terminated argument vector for the child. |
| envp | NULL-terminated environment vector for the child. |
| int posix_spawn_file_actions_addclose | ( | posix_spawn_file_actions_t * | file_actions, |
| int | fildes | ||
| ) |
Add a close action for descriptor fildes in the child.
| file_actions | File actions object. |
| fildes | Descriptor to close in the child. |
| int posix_spawn_file_actions_adddup2 | ( | posix_spawn_file_actions_t * | file_actions, |
| int | fildes, | ||
| int | newfildes | ||
| ) |
Add a dup2 action in the child, duplicating fildes onto newfildes.
| file_actions | File actions object. |
| fildes | Source descriptor. |
| newfildes | Destination descriptor in the child. |
| int posix_spawn_file_actions_addopen | ( | posix_spawn_file_actions_t * | file_actions, |
| int | fildes, | ||
| const char * | path, | ||
| int | oflag, | ||
| mode_t | mode | ||
| ) |
| int posix_spawn_file_actions_destroy | ( | posix_spawn_file_actions_t * | file_actions | ) |
Destroy a file actions object.
| file_actions | File actions object. |
| int posix_spawn_file_actions_init | ( | posix_spawn_file_actions_t * | file_actions | ) |
Initialize a file actions object with no actions.
| file_actions | File actions object. |
| int posix_spawnattr_destroy | ( | posix_spawnattr_t * | attr | ) |
Destroy a spawn attributes object.
| attr | Spawn attributes object. |
| int posix_spawnattr_getflags | ( | const posix_spawnattr_t * | attr, |
| short * | flags | ||
| ) |
Get the POSIX_SPAWN_* flags of a spawn attributes object.
| attr | Spawn attributes object. |
| flags | Output: current flags. |
| int posix_spawnattr_getpgroup | ( | const posix_spawnattr_t * | attr, |
| pid_t * | pgroup | ||
| ) |
Get the process group attribute.
| attr | Spawn attributes object. |
| pgroup | Output: current process group attribute. |
| int posix_spawnattr_getschedparam | ( | const posix_spawnattr_t * | attr, |
| struct sched_param * | schedparam | ||
| ) |
Get the scheduling parameter attribute.
| attr | Spawn attributes object. |
| schedparam | Output: current scheduling parameters. |
| int posix_spawnattr_getschedpolicy | ( | const posix_spawnattr_t * | attr, |
| int * | schedpolicy | ||
| ) |
Get the scheduling policy attribute.
| attr | Spawn attributes object. |
| schedpolicy | Output: current scheduling policy. |
| int posix_spawnattr_getsigdefault | ( | const posix_spawnattr_t * | attr, |
| sigset_t * | sigdefault | ||
| ) |
Get the default-signals attribute.
| attr | Spawn attributes object. |
| sigdefault | Output: signals reset to their default actions in the child. |
| int posix_spawnattr_getsigmask | ( | const posix_spawnattr_t * | attr, |
| sigset_t * | sigmask | ||
| ) |
Get the signal mask attribute.
| attr | Spawn attributes object. |
| sigmask | Output: signal mask applied to the child. |
| int posix_spawnattr_init | ( | posix_spawnattr_t * | attr | ) |
Initialize a spawn attributes object with default values.
| attr | Spawn attributes object. |
| int posix_spawnattr_setflags | ( | posix_spawnattr_t * | attr, |
| short | flags | ||
| ) |
Set the POSIX_SPAWN_* flags of a spawn attributes object.
| attr | Spawn attributes object. |
| flags | New flags. |
| int posix_spawnattr_setpgroup | ( | posix_spawnattr_t * | attr, |
| pid_t | pgroup | ||
| ) |
Set the process group attribute, applied with POSIX_SPAWN_SETPGROUP.
| attr | Spawn attributes object. |
| pgroup | Process group for the child; 0 starts a new group led by the child. |
| int posix_spawnattr_setschedparam | ( | posix_spawnattr_t * | attr, |
| const struct sched_param * | schedparam | ||
| ) |
Set the scheduling parameter attribute, applied with POSIX_SPAWN_SETSCHEDPARAM.
| attr | Spawn attributes object. |
| schedparam | Scheduling parameters for the child. |
| int posix_spawnattr_setschedpolicy | ( | posix_spawnattr_t * | attr, |
| int | schedpolicy | ||
| ) |
Set the scheduling policy attribute, applied with POSIX_SPAWN_SETSCHEDULER.
| attr | Spawn attributes object. |
| schedpolicy | Scheduling policy for the child. |
| int posix_spawnattr_setsigdefault | ( | posix_spawnattr_t * | attr, |
| const sigset_t * | sigdefault | ||
| ) |
Set the default-signals attribute, applied with POSIX_SPAWN_SETSIGDEF.
| attr | Spawn attributes object. |
| sigdefault | Signals reset to their default actions in the child. |
| int posix_spawnattr_setsigmask | ( | posix_spawnattr_t * | attr, |
| const sigset_t * | sigmask | ||
| ) |
Set the signal mask attribute, applied with POSIX_SPAWN_SETSIGMASK.
| attr | Spawn attributes object. |
| sigmask | Signal mask for the child. |
| int posix_spawnp | ( | pid_t * | pid, |
| const char * | file, | ||
| const posix_spawn_file_actions_t * | file_actions, | ||
| const posix_spawnattr_t * | attrp, | ||
| char *const | argv[], | ||
| char *const | envp[] | ||
| ) |
Spawn a new process, resolving file as posix_spawn() resolves a path.
| pid | Output: process ID of the child, or NULL. |
| file | Name of the executable image. |
| file_actions | File actions performed in the child, or NULL. |
| attrp | Spawn attributes, or NULL for defaults. |
| argv | NULL-terminated argument vector for the child. |
| envp | NULL-terminated environment vector for the child. |