spawn.h
001:
002:
003:
004:
005:
006:
007:
008:
009:
010:
011:
012:
013:
014:
015:
016:
017:
018:
019:
020: #ifndef _SPAWN_H
021: #define _SPAWN_H 1
022:
023: #include <features.h>
024: #include <sched.h>
025: #include <signal.h>
026: #include <sys/types.h>
027:
028:
029:
030: typedef struct
031: {
032: short int __flags;
033: pid_t __pgrp;
034: sigset_t __sd;
035: sigset_t __ss;
036: struct sched_param __sp;
037: int __policy;
038: int __pad[16];
039: } posix_spawnattr_t;
040:
041:
042:
043:
044: typedef struct
045: {
046: int __allocated;
047: int __used;
048: struct __spawn_action *__actions;
049: int __pad[16];
050: } posix_spawn_file_actions_t;
051:
052:
053:
054: #define POSIX_SPAWN_RESETIDS 0x01
055: #define POSIX_SPAWN_SETPGROUP 0x02
056: #define POSIX_SPAWN_SETSIGDEF 0x04
057: #define POSIX_SPAWN_SETSIGMASK 0x08
058: #define POSIX_SPAWN_SETSCHEDPARAM 0x10
059: #define POSIX_SPAWN_SETSCHEDULER 0x20
060: #ifdef __USE_GNU
061: # define POSIX_SPAWN_USEVFORK 0x40
062: #endif
063:
064:
065: __BEGIN_DECLS
066:
067:
068:
069:
070:
071:
072: extern int posix_spawn (pid_t *__restrict __pid,
073: __const char *__restrict __path,
074: __const posix_spawn_file_actions_t *__restrict
075: __file_actions,
076: __const posix_spawnattr_t *__restrict __attrp,
077: char *__const __argv[__restrict_arr],
078: char *__const __envp[__restrict_arr]);
079:
080:
081:
082:
083:
084: extern int posix_spawnp (pid_t *__pid, __const char *__file,
085: __const posix_spawn_file_actions_t *__file_actions,
086: __const posix_spawnattr_t *__attrp,
087: char *__const __argv[], char *__const __envp[]);
088:
089:
090:
091: extern int posix_spawnattr_init (posix_spawnattr_t *__attr) __THROW;
092:
093:
094: extern int posix_spawnattr_destroy (posix_spawnattr_t *__attr) __THROW;
095:
096:
097:
098: extern int posix_spawnattr_getsigdefault (__const posix_spawnattr_t *
099: __restrict __attr,
100: sigset_t *__restrict __sigdefault)
101: __THROW;
102:
103:
104: extern int posix_spawnattr_setsigdefault (posix_spawnattr_t *__restrict __attr,
105: __const sigset_t *__restrict
106: __sigdefault)
107: __THROW;
108:
109:
110: extern int posix_spawnattr_getsigmask (__const posix_spawnattr_t *__restrict
111: __attr,
112: sigset_t *__restrict __sigmask) __THROW;
113:
114:
115: extern int posix_spawnattr_setsigmask (posix_spawnattr_t *__restrict __attr,
116: __const sigset_t *__restrict __sigmask)
117: __THROW;
118:
119:
120: extern int posix_spawnattr_getflags (__const posix_spawnattr_t *__restrict
121: __attr,
122: short int *__restrict __flags) __THROW;
123:
124:
125: extern int posix_spawnattr_setflags (posix_spawnattr_t *_attr,
126: short int __flags) __THROW;
127:
128:
129: extern int posix_spawnattr_getpgroup (__const posix_spawnattr_t *__restrict
130: __attr, pid_t *__restrict __pgroup)
131: __THROW;
132:
133:
134: extern int posix_spawnattr_setpgroup (posix_spawnattr_t *__attr,
135: pid_t __pgroup) __THROW;
136:
137:
138: extern int posix_spawnattr_getschedpolicy (__const posix_spawnattr_t *
139: __restrict __attr,
140: int *__restrict __schedpolicy)
141: __THROW;
142:
143:
144: extern int posix_spawnattr_setschedpolicy (posix_spawnattr_t *__attr,
145: int __schedpolicy) __THROW;
146:
147:
148: extern int posix_spawnattr_getschedparam (__const posix_spawnattr_t *
149: __restrict __attr,
150: struct sched_param *__restrict
151: __schedparam) __THROW;
152:
153:
154: extern int posix_spawnattr_setschedparam (posix_spawnattr_t *__restrict __attr,
155: const struct sched_param *
156: __restrict __schedparam) __THROW;
157:
158:
159:
160: extern int posix_spawn_file_actions_init (posix_spawn_file_actions_t *
161: __file_actions) __THROW;
162:
163:
164: extern int posix_spawn_file_actions_destroy (posix_spawn_file_actions_t *
165: __file_actions) __THROW;
166:
167:
168:
169: extern int posix_spawn_file_actions_addopen (posix_spawn_file_actions_t *
170: __restrict __file_actions,
171: int __fd,
172: __const char *__restrict __path,
173: int __oflag, mode_t __mode)
174: __THROW;
175:
176:
177:
178: extern int posix_spawn_file_actions_addclose (posix_spawn_file_actions_t *
179: __file_actions, int __fd)
180: __THROW;
181:
182:
183:
184: extern int posix_spawn_file_actions_adddup2 (posix_spawn_file_actions_t *
185: __file_actions,
186: int __fd, int __newfd) __THROW;
187:
188: __END_DECLS
189:
190: #endif
191:
© Andrew Scott 2006 -
2024,
All Rights Reserved