4 * Function calls for spawning child processes.
6 * This file is part of the Mingw32 package.
9 * Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
11 * THIS SOFTWARE IS NOT COPYRIGHTED
13 * This source code is offered for use in the public domain. You may
14 * use, modify or distribute it freely.
16 * This code is distributed in the hope that it will be useful but
17 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
18 * DISCLAIMED. This includes but is not limited to warranties of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
23 * $Date: 2005/04/17 13:14:29 $
27 #ifndef __STRICT_ANSI__
32 /* All the headers include this file. */
35 /* Includes a definition of _pid_t and pid_t */
36 #include <sys/types.h>
39 * Constants for cwait actions.
43 #define _WAIT_GRANDCHILD 1
46 #define WAIT_CHILD _WAIT_CHILD
47 #define WAIT_GRANDCHILD _WAIT_GRANDCHILD
48 #endif /* Not _NO_OLDNAMES */
51 * Mode constants for spawn functions.
56 #define _OLD_P_OVERLAY _P_OVERLAY
61 #define P_WAIT _P_WAIT
62 #define P_NOWAIT _P_NOWAIT
63 #define P_OVERLAY _P_OVERLAY
64 #define OLD_P_OVERLAY _OLD_P_OVERLAY
65 #define P_NOWAITO _P_NOWAITO
66 #define P_DETACH _P_DETACH
67 #endif /* Not _NO_OLDNAMES */
79 int _cwait (int*, _pid_t
, int);
83 int _execl (const char*, const char*, ...);
84 int _execle (const char*, const char*, ...);
85 int _execlp (const char*, const char*, ...);
86 int _execlpe (const char*, const char*, ...);
87 int _execv (const char*, char* const*);
88 int _execve (const char*, char* const*, char* const*);
89 int _execvp (const char*, char* const*);
90 int _execvpe (const char*, char* const*, char* const*);
92 int _spawnl (int, const char*, const char*, ...);
93 int _spawnle (int, const char*, const char*, ...);
94 int _spawnlp (int, const char*, const char*, ...);
95 int _spawnlpe (int, const char*, const char*, ...);
96 int _spawnv (int, const char*, char* const*);
97 int _spawnve (int, const char*, char* const*, char* const*);
98 int _spawnvp (int, const char*, char* const*);
99 int _spawnvpe (int, const char*, char* const*, char* const*);
102 * The functions _beginthreadex and _endthreadex are not provided by CRTDLL.
103 * They are provided by MSVCRT.
105 * NOTE: Apparently _endthread calls CloseHandle on the handle of the thread,
106 * making for race conditions if you are not careful. Basically you have to
107 * make sure that no-one is going to do *anything* with the thread handle
108 * after the thread calls _endthread or returns from the thread function.
110 * NOTE: No old names for these functions. Use the underscore.
113 _beginthread (void (*)(void *), unsigned, void*);
114 void _endthread (void);
118 _beginthreadex (void *, unsigned, unsigned (__stdcall
*) (void *),
119 void*, unsigned, unsigned*);
120 void _endthreadex (unsigned);
126 * Functions without the leading underscore, for portability. These functions
127 * live in liboldnames.a.
129 int cwait (int*, pid_t
, int);
131 int execl (const char*, const char*, ...);
132 int execle (const char*, const char*, ...);
133 int execlp (const char*, const char*, ...);
134 int execlpe (const char*, const char*, ...);
135 int execv (const char*, char* const*);
136 int execve (const char*, char* const*, char* const*);
137 int execvp (const char*, char* const*);
138 int execvpe (const char*, char* const*, char* const*);
139 int spawnl (int, const char*, const char*, ...);
140 int spawnle (int, const char*, const char*, ...);
141 int spawnlp (int, const char*, const char*, ...);
142 int spawnlpe (int, const char*, const char*, ...);
143 int spawnv (int, const char*, char* const*);
144 int spawnve (int, const char*, char* const*, char* const*);
145 int spawnvp (int, const char*, char* const*);
146 int spawnvpe (int, const char*, char* const*, char* const*);
147 #endif /* Not _NO_OLDNAMES */
153 #endif /* Not RC_INVOKED */
155 #endif /* _PROCESS_H_ not defined */
157 #endif /* Not __STRICT_ANSI__ */