-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcygspawn.h
124 lines (95 loc) · 3.01 KB
/
cygspawn.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#ifndef CYGSPAWN_H
#define CYGSPAWN_H
#include <unistd.h>
#include <signal.h>
#include <sched.h>
#ifdef __cplusplus
extern "C" {
#endif
/* **** spawn **** */
typedef struct cygwin_spawn_ops *posix_spawn_file_actions_t;
typedef struct cygwin_spawn_info *posix_spawnattr_t;
int posix_spawn (
pid_t*restrict pid,
const char *restrict path,
const posix_spawn_file_actions_t *file_actions,
const posix_spawnattr_t *restrict attrp,
char *const restrict argv[restrict],
char *const restrict envp[restrict]);
int posix_spawnp (
pid_t*restrict pid,
const char *restrict path,
const posix_spawn_file_actions_t *file_actions,
const posix_spawnattr_t *restrict attrp,
char *const restrict argv[restrict],
char *const restrict envp[restrict]);
/* **** file_actions **** */
int posix_spawn_file_actions_init (
posix_spawn_file_actions_t *file_actions);
int posix_spawn_file_actions_destroy (
posix_spawn_file_actions_t *file_actions);
int posix_spawn_file_actions_addclose (
posix_spawn_file_actions_t *file_actions,
int filedes);
int posix_spawn_file_actions_adddup2 (
posix_spawn_file_actions_t *file_actions,
int filedes,
int newdes);
int posix_spawn_file_actions_addopen (
posix_spawn_file_actions_t *file_actions,
int filedes,
const char *restrict path,
int oflag,
mode_t mode);
/* *** spawnattr **** */
#define POSIX_SPAWN_RESETIDS (1<<0)
#define POSIX_SPAWN_SETPGROUP (1<<1)
#define POSIX_SPAWN_SETSCHEDPARAM (1<<2)
#define POSIX_SPAWN_SETSCHEDULER (1<<3)
#define POSIX_SPAWN_SETSIGDEF (1<<4)
#define POSIX_SPAWN_SETSIGMASK (1<<5)
#define CYGWIN_SPAWN_VALID_FLAGS ((1<<6) - 1)
int posix_spawnattr_init (
posix_spawnattr_t *attr);
int posix_spawnattr_destroy (
posix_spawnattr_t *attr);
int posix_spawnattr_getflags (
const posix_spawnattr_t *restrict attr,
short *restrict flags);
int posix_spawnattr_setflags (
posix_spawnattr_t *attr,
short flags);
int posix_spawnattr_getpgroup (
const posix_spawnattr_t *restrict attr,
pid_t *restrict pgroup);
int posix_spawnattr_setpgroup (
posix_spawnattr_t *attr,
pid_t pgroup);
int posix_spawnattr_getsigdefault (
const posix_spawnattr_t *restrict attr,
sigset_t *restrict sigdefault);
int posix_spawnattr_setsigdefault (
posix_spawnattr_t *restrict attr,
const sigset_t *restrict sigdefault);
int posix_spawnattr_getschedparam (
const posix_spawnattr_t *restrict attr,
struct sched_param *restrict schedparam);
int posix_spawnattr_setschedparam (
posix_spawnattr_t *restrict attr,
const struct sched_param *restrict schedparam);
int posix_spawnattr_getschedpolicy (
const posix_spawnattr_t *restrict attr,
int *restrict schedpolicy);
int posix_spawnattr_setschedpolicy (
posix_spawnattr_t *attr,
int schedpolicy);
int posix_spawnattr_getsigmask (
const posix_spawnattr_t *restrict attr,
sigset_t *restrict sigmask);
int posix_spawnattr_setsigmask (
posix_spawnattr_t *restrict attr,
const sigset_t *restrict sigmask);
#ifdef __cplusplus
}
#endif
#endif /* CYGSPAWN_H */