1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 #include <sys/types.h>
18
19
20 struct __spawn_action
21 {
22 enum
23 {
24 spawn_do_close,
25 spawn_do_dup2,
26 spawn_do_open,
27 spawn_do_chdir,
28 spawn_do_fchdir
29 } tag;
30
31 union
32 {
33 struct
34 {
35 int fd;
36 } close_action;
37 struct
38 {
39 int fd;
40 int newfd;
41 } dup2_action;
42 struct
43 {
44 int fd;
45 char *path;
46 int oflag;
47 mode_t mode;
48 } open_action;
49 struct
50 {
51 char *path;
52 } chdir_action;
53 struct
54 {
55 int fd;
56 } fchdir_action;
57 } action;
58 };
59
60 #if !_LIBC
61 # define __posix_spawn_file_actions_realloc gl_posix_spawn_file_actions_realloc
62 #endif
63 extern int __posix_spawn_file_actions_realloc (posix_spawn_file_actions_t *
64 file_actions);
65
66 #if !_LIBC
67 # define __spawni gl_posix_spawn_internal
68 #endif
69 extern int __spawni (pid_t *pid, const char *path,
70 const posix_spawn_file_actions_t *file_actions,
71 const posix_spawnattr_t *attrp, const char *const argv[],
72 const char *const envp[], int use_path);