posix-next API 0.1.0
Out-of-tree Zephyr POSIX module
Loading...
Searching...
No Matches
spawn.h File Reference

POSIX process spawning (<spawn.h>) More...

#include <sched.h>
#include <signal.h>
#include <sys/types.h>
Include dependency graph for spawn.h:

Go to the source code of this file.

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.
 

Detailed Description

POSIX process spawning (<spawn.h>)

Provides the POSIX spawn API for creating a new process from an executable image, with optional file actions and attributes applied in the child before it starts.

See also
POSIX.1-2017 <spawn.h>

Definition in file spawn.h.