2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the w64 mingw-runtime package.
4 * No warranty is given; refer to the file DISCLAIMER within this package.
11 /* Includes a definition of _pid_t and pid_t */
12 #include <sys/types.h>
21 #define _OLD_P_OVERLAY 2
27 #define _WAIT_GRANDCHILD 1
29 _CRTIMP
uintptr_t __cdecl
_beginthread(void (__cdecl
*_StartAddress
) (void *),unsigned _StackSize
,void *_ArgList
);
30 _CRTIMP
void __cdecl
_endthread(void);
31 _CRTIMP
uintptr_t __cdecl
_beginthreadex(void *_Security
,unsigned _StackSize
,unsigned (__stdcall
*_StartAddress
) (void *),void *_ArgList
,unsigned _InitFlag
,unsigned *_ThrdAddr
);
32 _CRTIMP
void __cdecl
_endthreadex(unsigned _Retval
);
34 #ifndef _CRT_TERMINATE_DEFINED
35 #define _CRT_TERMINATE_DEFINED
36 __declspec(noreturn
) void __cdecl
exit(int _Code
);
37 _CRTIMP
__declspec(noreturn
) void __cdecl
_exit(int _Code
);
39 #if __MINGW_GNUC_PREREQ(4,4)
40 #pragma push_macro("abort")
43 void __cdecl
__declspec(noreturn
) abort(void);
44 #if __MINGW_GNUC_PREREQ(4,4)
45 #pragma pop_macro("abort")
50 _CRTIMP
void __cdecl
_cexit(void);
51 _CRTIMP
void __cdecl
_c_exit(void);
52 _CRTIMP
int __cdecl
_getpid(void);
53 _CRTIMP
intptr_t __cdecl
_cwait(int *_TermStat
,intptr_t _ProcHandle
,int _Action
);
54 _CRTIMP
intptr_t __cdecl
_execl(const char *_Filename
,const char *_ArgList
,...);
55 _CRTIMP
intptr_t __cdecl
_execle(const char *_Filename
,const char *_ArgList
,...);
56 _CRTIMP
intptr_t __cdecl
_execlp(const char *_Filename
,const char *_ArgList
,...);
57 _CRTIMP
intptr_t __cdecl
_execlpe(const char *_Filename
,const char *_ArgList
,...);
58 _CRTIMP
intptr_t __cdecl
_execv(const char *_Filename
,const char *const *_ArgList
);
59 _CRTIMP
intptr_t __cdecl
_execve(const char *_Filename
,const char *const *_ArgList
,const char *const *_Env
);
60 _CRTIMP
intptr_t __cdecl
_execvp(const char *_Filename
,const char *const *_ArgList
);
61 _CRTIMP
intptr_t __cdecl
_execvpe(const char *_Filename
,const char *const *_ArgList
,const char *const *_Env
);
62 _CRTIMP
intptr_t __cdecl
_spawnl(int _Mode
,const char *_Filename
,const char *_ArgList
,...);
63 _CRTIMP
intptr_t __cdecl
_spawnle(int _Mode
,const char *_Filename
,const char *_ArgList
,...);
64 _CRTIMP
intptr_t __cdecl
_spawnlp(int _Mode
,const char *_Filename
,const char *_ArgList
,...);
65 _CRTIMP
intptr_t __cdecl
_spawnlpe(int _Mode
,const char *_Filename
,const char *_ArgList
,...);
66 _CRTIMP
intptr_t __cdecl
_spawnv(int _Mode
,const char *_Filename
,const char *const *_ArgList
);
67 _CRTIMP
intptr_t __cdecl
_spawnve(int _Mode
,const char *_Filename
,const char *const *_ArgList
,const char *const *_Env
);
68 _CRTIMP
intptr_t __cdecl
_spawnvp(int _Mode
,const char *_Filename
,const char *const *_ArgList
);
69 _CRTIMP
intptr_t __cdecl
_spawnvpe(int _Mode
,const char *_Filename
,const char *const *_ArgList
,const char *const *_Env
);
71 #ifndef _CRT_SYSTEM_DEFINED
72 #define _CRT_SYSTEM_DEFINED
73 int __cdecl
system(const char *_Command
);
76 #ifndef _WPROCESS_DEFINED
77 #define _WPROCESS_DEFINED
78 _CRTIMP
intptr_t __cdecl
_wexecl(const wchar_t *_Filename
,const wchar_t *_ArgList
,...);
79 _CRTIMP
intptr_t __cdecl
_wexecle(const wchar_t *_Filename
,const wchar_t *_ArgList
,...);
80 _CRTIMP
intptr_t __cdecl
_wexeclp(const wchar_t *_Filename
,const wchar_t *_ArgList
,...);
81 _CRTIMP
intptr_t __cdecl
_wexeclpe(const wchar_t *_Filename
,const wchar_t *_ArgList
,...);
82 _CRTIMP
intptr_t __cdecl
_wexecv(const wchar_t *_Filename
,const wchar_t *const *_ArgList
);
83 _CRTIMP
intptr_t __cdecl
_wexecve(const wchar_t *_Filename
,const wchar_t *const *_ArgList
,const wchar_t *const *_Env
);
84 _CRTIMP
intptr_t __cdecl
_wexecvp(const wchar_t *_Filename
,const wchar_t *const *_ArgList
);
85 _CRTIMP
intptr_t __cdecl
_wexecvpe(const wchar_t *_Filename
,const wchar_t *const *_ArgList
,const wchar_t *const *_Env
);
86 _CRTIMP
intptr_t __cdecl
_wspawnl(int _Mode
,const wchar_t *_Filename
,const wchar_t *_ArgList
,...);
87 _CRTIMP
intptr_t __cdecl
_wspawnle(int _Mode
,const wchar_t *_Filename
,const wchar_t *_ArgList
,...);
88 _CRTIMP
intptr_t __cdecl
_wspawnlp(int _Mode
,const wchar_t *_Filename
,const wchar_t *_ArgList
,...);
89 _CRTIMP
intptr_t __cdecl
_wspawnlpe(int _Mode
,const wchar_t *_Filename
,const wchar_t *_ArgList
,...);
90 _CRTIMP
intptr_t __cdecl
_wspawnv(int _Mode
,const wchar_t *_Filename
,const wchar_t *const *_ArgList
);
91 _CRTIMP
intptr_t __cdecl
_wspawnve(int _Mode
,const wchar_t *_Filename
,const wchar_t *const *_ArgList
,const wchar_t *const *_Env
);
92 _CRTIMP
intptr_t __cdecl
_wspawnvp(int _Mode
,const wchar_t *_Filename
,const wchar_t *const *_ArgList
);
93 _CRTIMP
intptr_t __cdecl
_wspawnvpe(int _Mode
,const wchar_t *_Filename
,const wchar_t *const *_ArgList
,const wchar_t *const *_Env
);
94 #ifndef _CRT_WSYSTEM_DEFINED
95 #define _CRT_WSYSTEM_DEFINED
96 _CRTIMP
int __cdecl
_wsystem(const wchar_t *_Command
);
100 void __cdecl
__security_init_cookie(void);
101 #if (defined(_X86_) && !defined(__x86_64))
102 void __fastcall
__security_check_cookie(uintptr_t _StackCookie
);
103 __declspec(noreturn
) void __cdecl
__report_gsfailure(void);
105 void __cdecl
__security_check_cookie(uintptr_t _StackCookie
);
106 __declspec(noreturn
) void __cdecl
__report_gsfailure(uintptr_t _StackCookie
);
108 extern uintptr_t __security_cookie
;
110 intptr_t __cdecl
_loaddll(char *_Filename
);
111 int __cdecl
_unloaddll(intptr_t _Handle
);
112 int (__cdecl
*__cdecl
_getdllprocaddr(intptr_t _Handle
,char *_ProcedureName
,intptr_t _Ordinal
))(void);
116 WINBOOL WINAPI
DllMain(HANDLE _HDllHandle
,DWORD _Reason
,LPVOID _Reserved
);
117 WINBOOL WINAPI
_CRT_INIT(HANDLE _HDllHandle
,DWORD _Reason
,LPVOID _Reserved
);
118 WINBOOL WINAPI
_wCRT_INIT(HANDLE _HDllHandle
,DWORD _Reason
,LPVOID _Reserved
);
119 extern WINBOOL (WINAPI
*const _pRawDllMain
)(HANDLE
,DWORD
,LPVOID
);
121 int __stdcall
DllMain(void *_HDllHandle
,unsigned _Reason
,void *_Reserved
);
122 int __stdcall
_CRT_INIT(void *_HDllHandle
,unsigned _Reason
,void *_Reserved
);
123 int __stdcall
_wCRT_INIT(void *_HDllHandle
,unsigned _Reason
,void *_Reserved
);
124 extern int (__stdcall
*const _pRawDllMain
)(void *,unsigned,void *);
129 #define P_WAIT _P_WAIT
130 #define P_NOWAIT _P_NOWAIT
131 #define P_OVERLAY _P_OVERLAY
132 #define OLD_P_OVERLAY _OLD_P_OVERLAY
133 #define P_NOWAITO _P_NOWAITO
134 #define P_DETACH _P_DETACH
135 #define WAIT_CHILD _WAIT_CHILD
136 #define WAIT_GRANDCHILD _WAIT_GRANDCHILD
138 intptr_t __cdecl
cwait(int *_TermStat
,intptr_t _ProcHandle
,int _Action
);
140 int __cdecl
execl(const char *_Filename
,const char *_ArgList
,...);
141 int __cdecl
execle(const char *_Filename
,const char *_ArgList
,...);
142 int __cdecl
execlp(const char *_Filename
,const char *_ArgList
,...);
143 int __cdecl
execlpe(const char *_Filename
,const char *_ArgList
,...);
145 intptr_t __cdecl
execl(const char *_Filename
,const char *_ArgList
,...);
146 intptr_t __cdecl
execle(const char *_Filename
,const char *_ArgList
,...);
147 intptr_t __cdecl
execlp(const char *_Filename
,const char *_ArgList
,...);
148 intptr_t __cdecl
execlpe(const char *_Filename
,const char *_ArgList
,...);
150 intptr_t __cdecl
spawnl(int,const char *_Filename
,const char *_ArgList
,...);
151 intptr_t __cdecl
spawnle(int,const char *_Filename
,const char *_ArgList
,...);
152 intptr_t __cdecl
spawnlp(int,const char *_Filename
,const char *_ArgList
,...);
153 intptr_t __cdecl
spawnlpe(int,const char *_Filename
,const char *_ArgList
,...);
154 int __cdecl
getpid(void);
156 /* Those methods are predefined by gcc builtins to return int. So to prevent
157 stupid warnings, define them in POSIX way. This is save, because those
158 methods do not return in success case, so that the return value is not
159 really dependent to its scalar width. */
160 int __cdecl
execv(const char *_Filename
,char *const _ArgList
[]);
161 int __cdecl
execve(const char *_Filename
,char *const _ArgList
[],char *const _Env
[]);
162 int __cdecl
execvp(const char *_Filename
,char *const _ArgList
[]);
163 int __cdecl
execvpe(const char *_Filename
,char *const _ArgList
[],char *const _Env
[]);
165 intptr_t __cdecl
execv(const char *_Filename
,char *const _ArgList
[]);
166 intptr_t __cdecl
execve(const char *_Filename
,char *const _ArgList
[],char *const _Env
[]);
167 intptr_t __cdecl
execvp(const char *_Filename
,char *const _ArgList
[]);
168 intptr_t __cdecl
execvpe(const char *_Filename
,char *const _ArgList
[],char *const _Env
[]);
170 intptr_t __cdecl
spawnv(int,const char *_Filename
,char *const _ArgList
[]);
171 intptr_t __cdecl
spawnve(int,const char *_Filename
,char *const _ArgList
[],char *const _Env
[]);
172 intptr_t __cdecl
spawnvp(int,const char *_Filename
,char *const _ArgList
[]);
173 intptr_t __cdecl
spawnvpe(int,const char *_Filename
,char *const _ArgList
[],char *const _Env
[]);