1*cda5da8dSAndroid Build Coastguard Worker #ifndef _SPAWN_H 2*cda5da8dSAndroid Build Coastguard Worker #define _SPAWN_H 3*cda5da8dSAndroid Build Coastguard Worker 4*cda5da8dSAndroid Build Coastguard Worker #ifdef __cplusplus 5*cda5da8dSAndroid Build Coastguard Worker extern "C" { 6*cda5da8dSAndroid Build Coastguard Worker #endif 7*cda5da8dSAndroid Build Coastguard Worker 8*cda5da8dSAndroid Build Coastguard Worker #include <features.h> 9*cda5da8dSAndroid Build Coastguard Worker 10*cda5da8dSAndroid Build Coastguard Worker #define __NEED_mode_t 11*cda5da8dSAndroid Build Coastguard Worker #define __NEED_pid_t 12*cda5da8dSAndroid Build Coastguard Worker #define __NEED_sigset_t 13*cda5da8dSAndroid Build Coastguard Worker 14*cda5da8dSAndroid Build Coastguard Worker #include <bits/alltypes.h> 15*cda5da8dSAndroid Build Coastguard Worker 16*cda5da8dSAndroid Build Coastguard Worker struct sched_param; 17*cda5da8dSAndroid Build Coastguard Worker 18*cda5da8dSAndroid Build Coastguard Worker #define POSIX_SPAWN_RESETIDS 1 19*cda5da8dSAndroid Build Coastguard Worker #define POSIX_SPAWN_SETPGROUP 2 20*cda5da8dSAndroid Build Coastguard Worker #define POSIX_SPAWN_SETSIGDEF 4 21*cda5da8dSAndroid Build Coastguard Worker #define POSIX_SPAWN_SETSIGMASK 8 22*cda5da8dSAndroid Build Coastguard Worker #define POSIX_SPAWN_SETSCHEDPARAM 16 23*cda5da8dSAndroid Build Coastguard Worker #define POSIX_SPAWN_SETSCHEDULER 32 24*cda5da8dSAndroid Build Coastguard Worker #define POSIX_SPAWN_USEVFORK 64 25*cda5da8dSAndroid Build Coastguard Worker #define POSIX_SPAWN_SETSID 128 26*cda5da8dSAndroid Build Coastguard Worker 27*cda5da8dSAndroid Build Coastguard Worker typedef struct { 28*cda5da8dSAndroid Build Coastguard Worker int __flags; 29*cda5da8dSAndroid Build Coastguard Worker pid_t __pgrp; 30*cda5da8dSAndroid Build Coastguard Worker sigset_t __def, __mask; 31*cda5da8dSAndroid Build Coastguard Worker int __prio, __pol; 32*cda5da8dSAndroid Build Coastguard Worker void *__fn; 33*cda5da8dSAndroid Build Coastguard Worker char __pad[64-sizeof(void *)]; 34*cda5da8dSAndroid Build Coastguard Worker } posix_spawnattr_t; 35*cda5da8dSAndroid Build Coastguard Worker 36*cda5da8dSAndroid Build Coastguard Worker typedef struct { 37*cda5da8dSAndroid Build Coastguard Worker int __pad0[2]; 38*cda5da8dSAndroid Build Coastguard Worker void *__actions; 39*cda5da8dSAndroid Build Coastguard Worker int __pad[16]; 40*cda5da8dSAndroid Build Coastguard Worker } posix_spawn_file_actions_t; 41*cda5da8dSAndroid Build Coastguard Worker 42*cda5da8dSAndroid Build Coastguard Worker int posix_spawn(pid_t *__restrict, const char *__restrict, const posix_spawn_file_actions_t *, 43*cda5da8dSAndroid Build Coastguard Worker const posix_spawnattr_t *__restrict, char *const *__restrict, char *const *__restrict); 44*cda5da8dSAndroid Build Coastguard Worker int posix_spawnp(pid_t *__restrict, const char *__restrict, const posix_spawn_file_actions_t *, 45*cda5da8dSAndroid Build Coastguard Worker const posix_spawnattr_t *__restrict, char *const *__restrict, char *const *__restrict); 46*cda5da8dSAndroid Build Coastguard Worker 47*cda5da8dSAndroid Build Coastguard Worker int posix_spawnattr_init(posix_spawnattr_t *); 48*cda5da8dSAndroid Build Coastguard Worker int posix_spawnattr_destroy(posix_spawnattr_t *); 49*cda5da8dSAndroid Build Coastguard Worker 50*cda5da8dSAndroid Build Coastguard Worker int posix_spawnattr_setflags(posix_spawnattr_t *, short); 51*cda5da8dSAndroid Build Coastguard Worker int posix_spawnattr_getflags(const posix_spawnattr_t *__restrict, short *__restrict); 52*cda5da8dSAndroid Build Coastguard Worker 53*cda5da8dSAndroid Build Coastguard Worker int posix_spawnattr_setpgroup(posix_spawnattr_t *, pid_t); 54*cda5da8dSAndroid Build Coastguard Worker int posix_spawnattr_getpgroup(const posix_spawnattr_t *__restrict, pid_t *__restrict); 55*cda5da8dSAndroid Build Coastguard Worker 56*cda5da8dSAndroid Build Coastguard Worker int posix_spawnattr_setsigmask(posix_spawnattr_t *__restrict, const sigset_t *__restrict); 57*cda5da8dSAndroid Build Coastguard Worker int posix_spawnattr_getsigmask(const posix_spawnattr_t *__restrict, sigset_t *__restrict); 58*cda5da8dSAndroid Build Coastguard Worker 59*cda5da8dSAndroid Build Coastguard Worker int posix_spawnattr_setsigdefault(posix_spawnattr_t *__restrict, const sigset_t *__restrict); 60*cda5da8dSAndroid Build Coastguard Worker int posix_spawnattr_getsigdefault(const posix_spawnattr_t *__restrict, sigset_t *__restrict); 61*cda5da8dSAndroid Build Coastguard Worker 62*cda5da8dSAndroid Build Coastguard Worker int posix_spawnattr_setschedparam(posix_spawnattr_t *__restrict, const struct sched_param *__restrict); 63*cda5da8dSAndroid Build Coastguard Worker int posix_spawnattr_getschedparam(const posix_spawnattr_t *__restrict, struct sched_param *__restrict); 64*cda5da8dSAndroid Build Coastguard Worker int posix_spawnattr_setschedpolicy(posix_spawnattr_t *, int); 65*cda5da8dSAndroid Build Coastguard Worker int posix_spawnattr_getschedpolicy(const posix_spawnattr_t *__restrict, int *__restrict); 66*cda5da8dSAndroid Build Coastguard Worker 67*cda5da8dSAndroid Build Coastguard Worker int posix_spawn_file_actions_init(posix_spawn_file_actions_t *); 68*cda5da8dSAndroid Build Coastguard Worker int posix_spawn_file_actions_destroy(posix_spawn_file_actions_t *); 69*cda5da8dSAndroid Build Coastguard Worker 70*cda5da8dSAndroid Build Coastguard Worker int posix_spawn_file_actions_addopen(posix_spawn_file_actions_t *__restrict, int, const char *__restrict, int, mode_t); 71*cda5da8dSAndroid Build Coastguard Worker int posix_spawn_file_actions_addclose(posix_spawn_file_actions_t *, int); 72*cda5da8dSAndroid Build Coastguard Worker int posix_spawn_file_actions_adddup2(posix_spawn_file_actions_t *, int, int); 73*cda5da8dSAndroid Build Coastguard Worker 74*cda5da8dSAndroid Build Coastguard Worker #if defined(_BSD_SOURCE) || defined(_GNU_SOURCE) 75*cda5da8dSAndroid Build Coastguard Worker int posix_spawn_file_actions_addchdir_np(posix_spawn_file_actions_t *__restrict, const char *__restrict); 76*cda5da8dSAndroid Build Coastguard Worker int posix_spawn_file_actions_addfchdir_np(posix_spawn_file_actions_t *, int); 77*cda5da8dSAndroid Build Coastguard Worker #endif 78*cda5da8dSAndroid Build Coastguard Worker 79*cda5da8dSAndroid Build Coastguard Worker #ifdef __cplusplus 80*cda5da8dSAndroid Build Coastguard Worker } 81*cda5da8dSAndroid Build Coastguard Worker #endif 82*cda5da8dSAndroid Build Coastguard Worker 83*cda5da8dSAndroid Build Coastguard Worker #endif 84