source: Daodan/MinGW/include/process.h@ 1051

Last change on this file since 1051 was 1046, checked in by alloc, 8 years ago

Daodan: Added Windows MinGW and build batch file

File size: 9.6 KB
Line 
1/*
2 * process.h
3 *
4 * Declarations of functions for spawning child processes.
5 *
6 * $Id: process.h,v 0e4f78dbc1ba 2016/06/17 14:16:01 keithmarshall $
7 *
8 * Written by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
9 * Copyright (C) 1997-2001, 2003-2004, 2007-2008, 2016, MinGW.org Project.
10 *
11 *
12 * Permission is hereby granted, free of charge, to any person obtaining a
13 * copy of this software and associated documentation files (the "Software"),
14 * to deal in the Software without restriction, including without limitation
15 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
16 * and/or sell copies of the Software, and to permit persons to whom the
17 * Software is furnished to do so, subject to the following conditions:
18 *
19 * The above copyright notice, this permission notice, and the following
20 * disclaimer shall be included in all copies or substantial portions of
21 * the Software.
22 *
23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OF OR OTHER
29 * DEALINGS IN THE SOFTWARE.
30 *
31 */
32#ifndef _PROCESS_H
33#pragma GCC system_header
34
35/* Defer defining the normal _PROCESS_H multiple inclusion guard macro,
36 * to facilitate selective inclusion by <wchar.h>, (in which case we do
37 * not wish to define it).
38 */
39#ifndef __WCHAR_H_SOURCED__
40#define _PROCESS_H
41
42/* All MinGW headers must include <_mingw.h>; do so here, assuming
43 * that <wchar.h> will have already taken care of it, for the case
44 * of selective inclusion.
45 */
46#include <_mingw.h>
47
48/* This gives us more than we really need, but it gets us _pid_t
49 * (and its pid_t equivalent), which we do need.
50 */
51#include <sys/types.h>
52
53/* Constants for cwait actions; obsolete for Win32.
54 */
55#define _WAIT_CHILD 0
56#define _WAIT_GRANDCHILD 1
57
58#ifndef _NO_OLDNAMES
59#define WAIT_CHILD _WAIT_CHILD
60#define WAIT_GRANDCHILD _WAIT_GRANDCHILD
61#endif /* !_NO_OLDNAMES */
62#endif /* !__WCHAR_H_SOURCED__ */
63
64/* Mode constants for spawn() functions.
65 */
66#define _P_WAIT 0
67#define _P_NOWAIT 1
68#define _P_OVERLAY 2
69#define _OLD_P_OVERLAY _P_OVERLAY
70#define _P_NOWAITO 3
71#define _P_DETACH 4
72
73#ifndef _NO_OLDNAMES
74#define P_WAIT _P_WAIT
75#define P_NOWAIT _P_NOWAIT
76#define P_OVERLAY _P_OVERLAY
77#define OLD_P_OVERLAY _OLD_P_OVERLAY
78#define P_NOWAITO _P_NOWAITO
79#define P_DETACH _P_DETACH
80#endif /* !_NO_OLDNAMES */
81
82#ifndef RC_INVOKED
83
84/* All Microsoft implementations of the exec() and spawn() functions
85 * are declared with intptr_t as their return type; get its definition
86 * by selective inclusion from "stdint.h"; (note: use #include "..."
87 * here, to avoid side effects from any alternative <stdint.h>, which
88 * is not in the same directory as this <process.h>).
89 */
90#define __need_intptr_t
91#include "stdint.h"
92
93_BEGIN_C_DECLS
94
95#ifdef _PROCESS_H
96_CRTIMP __cdecl __MINGW_NOTHROW void _cexit (void);
97_CRTIMP __cdecl __MINGW_NOTHROW void _c_exit (void);
98
99_CRTIMP __cdecl __MINGW_NOTHROW int _cwait (int *, _pid_t, int);
100
101_CRTIMP __cdecl __MINGW_NOTHROW _pid_t _getpid (void);
102
103_CRTIMP __cdecl __MINGW_NOTHROW
104intptr_t _execl (const char *, const char *, ...);
105
106_CRTIMP __cdecl __MINGW_NOTHROW
107intptr_t _execle (const char *, const char *, ...);
108
109_CRTIMP __cdecl __MINGW_NOTHROW
110intptr_t _execlp (const char *, const char *, ...);
111
112_CRTIMP __cdecl __MINGW_NOTHROW
113intptr_t _execlpe (const char *, const char *, ...);
114
115_CRTIMP __cdecl __MINGW_NOTHROW
116intptr_t _execv (const char *, const char * const *);
117
118_CRTIMP __cdecl __MINGW_NOTHROW
119intptr_t _execve (const char *, const char * const *, const char * const *);
120
121_CRTIMP __cdecl __MINGW_NOTHROW
122intptr_t _execvp (const char *, const char * const *);
123
124_CRTIMP __cdecl __MINGW_NOTHROW
125intptr_t _execvpe (const char *, const char * const *, const char * const *);
126
127_CRTIMP __cdecl __MINGW_NOTHROW
128intptr_t _spawnl (int, const char *, const char *, ...);
129
130_CRTIMP __cdecl __MINGW_NOTHROW
131intptr_t _spawnle (int, const char *, const char *, ...);
132
133_CRTIMP __cdecl __MINGW_NOTHROW
134intptr_t _spawnlp (int, const char *, const char *, ...);
135
136_CRTIMP __cdecl __MINGW_NOTHROW
137intptr_t _spawnlpe (int, const char *, const char *, ...);
138
139_CRTIMP __cdecl __MINGW_NOTHROW
140intptr_t _spawnv (int, const char *, const char * const *);
141
142_CRTIMP __cdecl __MINGW_NOTHROW
143intptr_t _spawnve (int, const char *, const char * const *, const char * const *);
144
145_CRTIMP __cdecl __MINGW_NOTHROW
146intptr_t _spawnvp (int, const char *, const char * const *);
147
148_CRTIMP __cdecl __MINGW_NOTHROW
149intptr_t _spawnvpe (int, const char *, const char * const *, const char * const *);
150
151/* Thread initiation and termination functions.
152 *
153 * NOTE: Apparently _endthread() calls CloseHandle() on the handle of the
154 * thread, creating a potential for race conditions, if you are not careful.
155 * Basically, you MUST ensure that NOTHING attempts to do ANYTHING with the
156 * thread handle after the thread calls _endthread(), or returns from the
157 * thread function.
158 *
159 * NOTE: No old names for these functions. Use the underscore.
160 */
161_CRTIMP __cdecl __MINGW_NOTHROW
162unsigned long _beginthread (void (*)(void *), unsigned, void *);
163
164_CRTIMP __cdecl __MINGW_NOTHROW void _endthread (void);
165
166#ifdef __MSVCRT__
167_CRTIMP __cdecl __MINGW_NOTHROW unsigned long _beginthreadex
168(void *, unsigned, unsigned (__stdcall *) (void *), void *, unsigned, unsigned *);
169
170_CRTIMP __cdecl __MINGW_NOTHROW void _endthreadex (unsigned);
171#endif
172
173#ifndef _NO_OLDNAMES
174/* Functions named without the leading underscore, for portability.
175 * These functions live in liboldnames.a.
176 */
177_CRTIMP __cdecl __MINGW_NOTHROW int cwait (int *, pid_t, int);
178_CRTIMP __cdecl __MINGW_NOTHROW pid_t getpid (void);
179
180_CRTIMP __cdecl __MINGW_NOTHROW
181intptr_t execl (const char *, const char *, ...);
182
183_CRTIMP __cdecl __MINGW_NOTHROW
184intptr_t execle (const char *, const char *, ...);
185
186_CRTIMP __cdecl __MINGW_NOTHROW
187intptr_t execlp (const char *, const char *, ...);
188
189_CRTIMP __cdecl __MINGW_NOTHROW
190intptr_t execlpe (const char *, const char *,...);
191
192_CRTIMP __cdecl __MINGW_NOTHROW
193intptr_t execv (const char *, const char * const *);
194
195_CRTIMP __cdecl __MINGW_NOTHROW
196intptr_t execve (const char *, const char * const *, const char * const *);
197
198_CRTIMP __cdecl __MINGW_NOTHROW
199intptr_t execvp (const char *, const char * const *);
200
201_CRTIMP __cdecl __MINGW_NOTHROW
202intptr_t execvpe (const char *, const char * const *, const char * const *);
203
204_CRTIMP __cdecl __MINGW_NOTHROW
205intptr_t spawnl (int, const char *, const char *, ...);
206
207_CRTIMP __cdecl __MINGW_NOTHROW
208intptr_t spawnle (int, const char *, const char *, ...);
209
210_CRTIMP __cdecl __MINGW_NOTHROW
211intptr_t spawnlp (int, const char *, const char *, ...);
212
213_CRTIMP __cdecl __MINGW_NOTHROW
214intptr_t spawnlpe (int, const char *, const char *, ...);
215
216_CRTIMP __cdecl __MINGW_NOTHROW
217intptr_t spawnv (int, const char *, const char * const *);
218
219_CRTIMP __cdecl __MINGW_NOTHROW
220intptr_t spawnve (int, const char *, const char * const *, const char * const *);
221
222_CRTIMP __cdecl __MINGW_NOTHROW
223intptr_t spawnvp (int, const char *, const char * const *);
224
225_CRTIMP __cdecl __MINGW_NOTHROW
226intptr_t spawnvpe (int, const char *, const char * const *, const char * const *);
227
228#endif /* !_NO_OLDNAMES */
229#endif /* _PROCESS_H */
230
231#if ! (defined _PROCESS_H && defined _WCHAR_H)
232/* Wide character variations of the exec() and spawn() functions are
233 * declared both when <process.h> is included directly, and when it is
234 * selectively included by <wchar.h>; however, if both _PROCESS_H and
235 * _WCHAR_H are defined, by the time we get to here, then this must be
236 * the direct inclusion case, and these have already been declared as
237 * a result of selective inclusion; there is no need to declare them
238 * a second time.
239 */
240_CRTIMP __cdecl __MINGW_NOTHROW
241intptr_t _wexecl (const wchar_t *, const wchar_t *, ...);
242
243_CRTIMP __cdecl __MINGW_NOTHROW
244intptr_t _wexecle (const wchar_t *, const wchar_t *, ...);
245
246_CRTIMP __cdecl __MINGW_NOTHROW
247intptr_t _wexeclp (const wchar_t *, const wchar_t *, ...);
248
249_CRTIMP __cdecl __MINGW_NOTHROW
250intptr_t _wexeclpe (const wchar_t *, const wchar_t *, ...);
251
252_CRTIMP __cdecl __MINGW_NOTHROW
253intptr_t _wexecv (const wchar_t *, const wchar_t * const *);
254
255_CRTIMP __cdecl __MINGW_NOTHROW intptr_t _wexecve
256(const wchar_t *, const wchar_t * const *, const wchar_t * const *);
257
258_CRTIMP __cdecl __MINGW_NOTHROW
259intptr_t _wexecvp (const wchar_t *, const wchar_t * const *);
260
261_CRTIMP __cdecl __MINGW_NOTHROW intptr_t _wexecvpe
262(const wchar_t *, const wchar_t * const *, const wchar_t * const *);
263
264_CRTIMP __cdecl __MINGW_NOTHROW
265intptr_t _wspawnl (int, const wchar_t *, const wchar_t *, ...);
266
267_CRTIMP __cdecl __MINGW_NOTHROW
268intptr_t _wspawnle (int, const wchar_t *, const wchar_t *, ...);
269
270_CRTIMP __cdecl __MINGW_NOTHROW
271intptr_t _wspawnlp (int, const wchar_t *, const wchar_t *, ...);
272
273_CRTIMP __cdecl __MINGW_NOTHROW
274intptr_t _wspawnlpe (int, const wchar_t *, const wchar_t *, ...);
275
276_CRTIMP __cdecl __MINGW_NOTHROW
277intptr_t _wspawnv (int, const wchar_t *, const wchar_t * const *);
278
279_CRTIMP __cdecl __MINGW_NOTHROW intptr_t _wspawnve
280(int, const wchar_t *, const wchar_t * const *, const wchar_t * const *);
281
282_CRTIMP __cdecl __MINGW_NOTHROW
283intptr_t _wspawnvp (int, const wchar_t *, const wchar_t * const *);
284
285_CRTIMP __cdecl __MINGW_NOTHROW intptr_t _wspawnvpe
286(int, const wchar_t *, const wchar_t * const *, const wchar_t * const *);
287
288#endif /* ! (_PROCESS_H && _WCHAR_H) */
289
290_END_C_DECLS
291
292#endif /* ! RC_INVOKED */
293#endif /* !_PROCESS_H: $RCSfile: process.h,v $: end of file */
Note: See TracBrowser for help on using the repository browser.