|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include <sys/types.h> |
|
|
|
|
|
struct __spawn_action |
|
{ |
|
enum |
|
{ |
|
spawn_do_close, |
|
spawn_do_dup2, |
|
spawn_do_open, |
|
spawn_do_chdir, |
|
spawn_do_fchdir |
|
} tag; |
|
|
|
union |
|
{ |
|
struct |
|
{ |
|
int fd; |
|
} close_action; |
|
struct |
|
{ |
|
int fd; |
|
int newfd; |
|
} dup2_action; |
|
struct |
|
{ |
|
int fd; |
|
char *path; |
|
int oflag; |
|
mode_t mode; |
|
} open_action; |
|
struct |
|
{ |
|
char *path; |
|
} chdir_action; |
|
struct |
|
{ |
|
int fd; |
|
} fchdir_action; |
|
} action; |
|
}; |
|
|
|
#if !_LIBC |
|
# define __posix_spawn_file_actions_realloc gl_posix_spawn_file_actions_realloc |
|
#endif |
|
extern int __posix_spawn_file_actions_realloc (posix_spawn_file_actions_t * |
|
file_actions); |
|
|
|
#if !_LIBC |
|
# define __spawni gl_posix_spawn_internal |
|
#endif |
|
extern int __spawni (pid_t *pid, const char *path, |
|
const posix_spawn_file_actions_t *file_actions, |
|
const posix_spawnattr_t *attrp, const char *const argv[], |
|
const char *const envp[], int use_path); |
|
|