3 * This file has no copyright assigned and is placed in the Public Domain.
4 * This file is a part of the mingw-runtime package.
5 * No warranty is given; refer to the file DISCLAIMER within the package.
7 * Function calls for spawning child processes.
14 /* All the headers include this file. */
17 #include <sys/types.h> /* For _pid_t and pid_t. */
18 #include <stdint.h> /* For intptr_t. */
20 * Constants for cwait actions.
24 #define _WAIT_GRANDCHILD 1
27 #define WAIT_CHILD _WAIT_CHILD
28 #define WAIT_GRANDCHILD _WAIT_GRANDCHILD
29 #endif /* Not _NO_OLDNAMES */
32 * Mode constants for spawn functions.
37 #define _OLD_P_OVERLAY _P_OVERLAY
42 #define P_WAIT _P_WAIT
43 #define P_NOWAIT _P_NOWAIT
44 #define P_OVERLAY _P_OVERLAY
45 #define OLD_P_OVERLAY _OLD_P_OVERLAY
46 #define P_NOWAITO _P_NOWAITO
47 #define P_DETACH _P_DETACH
48 #endif /* Not _NO_OLDNAMES */
57 _CRTIMP void __cdecl __MINGW_NOTHROW _cexit(void);
58 _CRTIMP void __cdecl __MINGW_NOTHROW _c_exit(void);
60 _CRTIMP int __cdecl __MINGW_NOTHROW _cwait (int*, _pid_t, int);
62 _CRTIMP _pid_t __cdecl __MINGW_NOTHROW _getpid(void);
64 _CRTIMP intptr_t __cdecl __MINGW_NOTHROW _execl (const char*, const char*, ...);
65 _CRTIMP intptr_t __cdecl __MINGW_NOTHROW _execle (const char*, const char*, ...);
66 _CRTIMP intptr_t __cdecl __MINGW_NOTHROW _execlp (const char*, const char*, ...);
67 _CRTIMP intptr_t __cdecl __MINGW_NOTHROW _execlpe (const char*, const char*, ...);
68 _CRTIMP intptr_t __cdecl __MINGW_NOTHROW _execv (const char*, const char* const*);
69 _CRTIMP intptr_t __cdecl __MINGW_NOTHROW _execve (const char*, const char* const*, const char* const*);
70 _CRTIMP intptr_t __cdecl __MINGW_NOTHROW _execvp (const char*, const char* const*);
71 _CRTIMP intptr_t __cdecl __MINGW_NOTHROW _execvpe (const char*, const char* const*, const char* const*);
73 _CRTIMP intptr_t __cdecl __MINGW_NOTHROW _spawnl (int, const char*, const char*, ...);
74 _CRTIMP intptr_t __cdecl __MINGW_NOTHROW _spawnle (int, const char*, const char*, ...);
75 _CRTIMP intptr_t __cdecl __MINGW_NOTHROW _spawnlp (int, const char*, const char*, ...);
76 _CRTIMP intptr_t __cdecl __MINGW_NOTHROW _spawnlpe (int, const char*, const char*, ...);
77 _CRTIMP intptr_t __cdecl __MINGW_NOTHROW _spawnv (int, const char*, const char* const*);
78 _CRTIMP intptr_t __cdecl __MINGW_NOTHROW _spawnve (int, const char*, const char* const*, const char* const*);
79 _CRTIMP intptr_t __cdecl __MINGW_NOTHROW _spawnvp (int, const char*, const char* const*);
80 _CRTIMP intptr_t __cdecl __MINGW_NOTHROW _spawnvpe (int, const char*, const char* const*, const char* const*);
82 #ifndef _WPROCESS_DEFINED
83 /* Also in wchar.h - keep in sync */
84 _CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wexecl (const wchar_t*, const wchar_t*, ...);
85 _CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wexecle (const wchar_t*, const wchar_t*, ...);
86 _CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wexeclp (const wchar_t*, const wchar_t*, ...);
87 _CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wexeclpe (const wchar_t*, const wchar_t*, ...);
88 _CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wexecv (const wchar_t*, const wchar_t* const*);
89 _CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wexecve (const wchar_t*, const wchar_t* const*, const wchar_t* const*);
90 _CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wexecvp (const wchar_t*, const wchar_t* const*);
91 _CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wexecvpe (const wchar_t*, const wchar_t* const*, const wchar_t* const*);
93 _CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wspawnl (int, const wchar_t*, const wchar_t*, ...);
94 _CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wspawnle (int, const wchar_t*, const wchar_t*, ...);
95 _CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wspawnlp (int, const wchar_t*, const wchar_t*, ...);
96 _CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wspawnlpe (int, const wchar_t*, const wchar_t*, ...);
97 _CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wspawnv (int, const wchar_t*, const wchar_t* const*);
98 _CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wspawnve (int, const wchar_t*, const wchar_t* const*, const wchar_t* const*);
99 _CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wspawnvp (int, const wchar_t*, const wchar_t* const*);
100 _CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wspawnvpe (int, const wchar_t*, const wchar_t* const*, const wchar_t* const*);
102 #define _WPROCESS_DEFINED
106 * The functions _beginthreadex and _endthreadex are not provided by CRTDLL.
107 * They are provided by MSVCRT.
109 * NOTE: Apparently _endthread calls CloseHandle on the handle of the thread,
110 * making for race conditions if you are not careful. Basically you have to
111 * make sure that no-one is going to do *anything* with the thread handle
112 * after the thread calls _endthread or returns from the thread function.
114 * NOTE: No old names for these functions. Use the underscore.
116 _CRTIMP unsigned long __cdecl __MINGW_NOTHROW
117 _beginthread (void (*)(void *), unsigned, void*);
118 _CRTIMP void __cdecl __MINGW_NOTHROW _endthread (void);
121 _CRTIMP unsigned long __cdecl __MINGW_NOTHROW
122 _beginthreadex (void *, unsigned, unsigned (__stdcall *) (void *),
123 void*, unsigned, unsigned*);
124 _CRTIMP void __cdecl __MINGW_NOTHROW _endthreadex (unsigned);
130 * Functions without the leading underscore, for portability. These functions
131 * live in liboldnames.a.
133 _CRTIMP int __cdecl __MINGW_NOTHROW cwait (int*, pid_t, int);
134 _CRTIMP pid_t __cdecl __MINGW_NOTHROW getpid (void);
136 _CRTIMP intptr_t __cdecl __MINGW_NOTHROW execl (const char*, const char*, ...);
137 _CRTIMP intptr_t __cdecl __MINGW_NOTHROW execle (const char*, const char*, ...);
138 _CRTIMP intptr_t __cdecl __MINGW_NOTHROW execlp (const char*, const char*, ...);
139 _CRTIMP intptr_t __cdecl __MINGW_NOTHROW execlpe (const char*, const char*,...);
140 _CRTIMP intptr_t __cdecl __MINGW_NOTHROW execv (const char*, const char* const*);
141 _CRTIMP intptr_t __cdecl __MINGW_NOTHROW execve (const char*, const char* const*, const char* const*);
142 _CRTIMP intptr_t __cdecl __MINGW_NOTHROW execvp (const char*, const char* const*);
143 _CRTIMP intptr_t __cdecl __MINGW_NOTHROW execvpe (const char*, const char* const*, const char* const*);
145 _CRTIMP intptr_t __cdecl __MINGW_NOTHROW spawnl (int, const char*, const char*, ...);
146 _CRTIMP intptr_t __cdecl __MINGW_NOTHROW spawnle (int, const char*, const char*, ...);
147 _CRTIMP intptr_t __cdecl __MINGW_NOTHROW spawnlp (int, const char*, const char*, ...);
148 _CRTIMP intptr_t __cdecl __MINGW_NOTHROW spawnlpe (int, const char*, const char*, ...);
149 _CRTIMP intptr_t __cdecl __MINGW_NOTHROW spawnv (int, const char*, const char* const*);
150 _CRTIMP intptr_t __cdecl __MINGW_NOTHROW spawnve (int, const char*, const char* const*, const char* const*);
151 _CRTIMP intptr_t __cdecl __MINGW_NOTHROW spawnvp (int, const char*, const char* const*);
152 _CRTIMP intptr_t __cdecl __MINGW_NOTHROW spawnvpe (int, const char*, const char* const*, const char* const*);
153 #endif /* Not _NO_OLDNAMES */
159 #endif /* Not RC_INVOKED */
161 #endif /* _PROCESS_H_ not defined */