4 * Derived from the mingw header written by Colin Peters.
5 * Modified for Wine use by Jon Griffiths and Francois Gouget.
6 * This file is in the public domain.
8 #ifndef __WINE_PROCESS_H
9 #define __WINE_PROCESS_H
11 #include <corecrt_startup.h>
12 #include <corecrt_wprocess.h>
14 /* Process creation flags */
22 #define _WAIT_GRANDCHILD 1
28 typedef void (__cdecl
*_beginthread_start_routine_t
)(void *);
29 typedef unsigned int (__stdcall
*_beginthreadex_start_routine_t
)(void *);
31 _ACRTIMP
uintptr_t __cdecl
_beginthread(_beginthread_start_routine_t
,unsigned int,void*);
32 _ACRTIMP
uintptr_t __cdecl
_beginthreadex(void*,unsigned int,_beginthreadex_start_routine_t
,void*,unsigned int,unsigned int*);
33 _ACRTIMP
intptr_t __cdecl
_cwait(int*,intptr_t,int);
34 _ACRTIMP DECLSPEC_NORETURN
void __cdecl
_endthread(void);
35 _ACRTIMP DECLSPEC_NORETURN
void __cdecl
_endthreadex(unsigned int);
36 _ACRTIMP
intptr_t WINAPIV
_execl(const char*,const char*,...);
37 _ACRTIMP
intptr_t WINAPIV
_execle(const char*,const char*,...);
38 _ACRTIMP
intptr_t WINAPIV
_execlp(const char*,const char*,...);
39 _ACRTIMP
intptr_t WINAPIV
_execlpe(const char*,const char*,...);
40 _ACRTIMP
intptr_t __cdecl
_execv(const char*,const char* const *);
41 _ACRTIMP
intptr_t __cdecl
_execve(const char*,const char* const *,const char* const *);
42 _ACRTIMP
intptr_t __cdecl
_execvp(const char*,const char* const *);
43 _ACRTIMP
intptr_t __cdecl
_execvpe(const char*,const char* const *,const char* const *);
44 _ACRTIMP
int __cdecl
_getpid(void);
45 _ACRTIMP
intptr_t WINAPIV
_spawnl(int,const char*,const char*,...);
46 _ACRTIMP
intptr_t WINAPIV
_spawnle(int,const char*,const char*,...);
47 _ACRTIMP
intptr_t WINAPIV
_spawnlp(int,const char*,const char*,...);
48 _ACRTIMP
intptr_t WINAPIV
_spawnlpe(int,const char*,const char*,...);
49 _ACRTIMP
intptr_t __cdecl
_spawnv(int,const char*,const char* const *);
50 _ACRTIMP
intptr_t __cdecl
_spawnve(int,const char*,const char* const *,const char* const *);
51 _ACRTIMP
intptr_t __cdecl
_spawnvp(int,const char*,const char* const *);
52 _ACRTIMP
intptr_t __cdecl
_spawnvpe(int,const char*,const char* const *,const char* const *);
54 _ACRTIMP
void __cdecl
_c_exit(void);
55 _ACRTIMP
void __cdecl
_cexit(void);
56 _ACRTIMP DECLSPEC_NORETURN
void __cdecl
_exit(int);
57 _ACRTIMP DECLSPEC_NORETURN
void __cdecl
abort(void);
58 _ACRTIMP DECLSPEC_NORETURN
void __cdecl
exit(int);
59 _ACRTIMP DECLSPEC_NORETURN
void __cdecl
quick_exit(int);
60 _ACRTIMP
int __cdecl
system(const char*);
67 #define P_WAIT _P_WAIT
68 #define P_NOWAIT _P_NOWAIT
69 #define P_OVERLAY _P_OVERLAY
70 #define P_NOWAITO _P_NOWAITO
71 #define P_DETACH _P_DETACH
73 #define WAIT_CHILD _WAIT_CHILD
74 #define WAIT_GRANDCHILD _WAIT_GRANDCHILD
76 static inline intptr_t cwait(int *status
, intptr_t pid
, int action
) { return _cwait(status
, pid
, action
); }
77 static inline int getpid(void) { return _getpid(); }
78 static inline intptr_t spawnv(int flags
, const char* name
, const char* const* argv
) { return _spawnv(flags
, name
, argv
); }
79 static inline intptr_t spawnve(int flags
, const char* name
, const char* const* argv
, const char* const* envv
) { return _spawnve(flags
, name
, argv
, envv
); }
80 static inline intptr_t spawnvp(int flags
, const char* name
, const char* const* argv
) { return _spawnvp(flags
, name
, argv
); }
81 static inline intptr_t spawnvpe(int flags
, const char* name
, const char* const* argv
, const char* const* envv
) { return _spawnvpe(flags
, name
, argv
, envv
); }
83 #define execve _execve
84 #define execvp _execvp
85 #define execvpe _execvpe
87 #if defined(__GNUC__) && (__GNUC__ < 4)
88 _ACRTIMP
intptr_t WINAPIV
execl(const char*,const char*,...) __attribute__((alias("_execl")));
89 _ACRTIMP
intptr_t WINAPIV
execle(const char*,const char*,...) __attribute__((alias("_execle")));
90 _ACRTIMP
intptr_t WINAPIV
execlp(const char*,const char*,...) __attribute__((alias("_execlp")));
91 _ACRTIMP
intptr_t WINAPIV
execlpe(const char*,const char*,...) __attribute__((alias("_execlpe")));
92 _ACRTIMP
intptr_t WINAPIV
spawnl(int,const char*,const char*,...) __attribute__((alias("_spawnl")));
93 _ACRTIMP
intptr_t WINAPIV
spawnle(int,const char*,const char*,...) __attribute__((alias("_spawnle")));
94 _ACRTIMP
intptr_t WINAPIV
spawnlp(int,const char*,const char*,...) __attribute__((alias("_spawnlp")));
95 _ACRTIMP
intptr_t WINAPIV
spawnlpe(int,const char*,const char*,...) __attribute__((alias("_spawnlpe")));
98 #define execle _execle
99 #define execlp _execlp
100 #define execlpe _execlpe
101 #define spawnl _spawnl
102 #define spawnle _spawnle
103 #define spawnlp _spawnlp
104 #define spawnlpe _spawnlpe
105 #endif /* __GNUC__ */
107 #endif /* __WINE_PROCESS_H */