1 | /* Data structure to contain the action information. */ |
2 | struct __spawn_action |
3 | { |
4 | enum |
5 | { |
6 | spawn_do_close, |
7 | spawn_do_dup2, |
8 | spawn_do_open |
9 | } tag; |
10 | |
11 | union |
12 | { |
13 | struct |
14 | { |
15 | int fd; |
16 | } close_action; |
17 | struct |
18 | { |
19 | int fd; |
20 | int newfd; |
21 | } dup2_action; |
22 | struct |
23 | { |
24 | int fd; |
25 | char *path; |
26 | int oflag; |
27 | mode_t mode; |
28 | } open_action; |
29 | } action; |
30 | }; |
31 | |
32 | #define SPAWN_XFLAGS_USE_PATH 0x1 |
33 | #define SPAWN_XFLAGS_TRY_SHELL 0x2 |
34 | |
35 | extern int __posix_spawn_file_actions_realloc (posix_spawn_file_actions_t * |
36 | file_actions); |
37 | |
38 | extern int __spawni (pid_t *pid, const char *path, |
39 | const posix_spawn_file_actions_t *file_actions, |
40 | const posix_spawnattr_t *attrp, char *const argv[], |
41 | char *const envp[], int xflags); |
42 | |