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
13 /* Process creation flags */
21 #define _WAIT_GRANDCHILD 1
27 typedef void (__cdecl *_beginthread_start_routine_t)(void *);
28 typedef unsigned int (__stdcall *_beginthreadex_start_routine_t)(void *);
30 uintptr_t __cdecl _beginthread(_beginthread_start_routine_t,unsigned int,void*);
31 uintptr_t __cdecl _beginthreadex(void*,unsigned int,_beginthreadex_start_routine_t,void*,unsigned int,unsigned int*);
32 intptr_t __cdecl _cwait(int*,intptr_t,int);
33 void __cdecl _endthread(void);
34 void __cdecl _endthreadex(unsigned int);
35 intptr_t __cdecl _execl(const char*,const char*,...);
36 intptr_t __cdecl _execle(const char*,const char*,...);
37 intptr_t __cdecl _execlp(const char*,const char*,...);
38 intptr_t __cdecl _execlpe(const char*,const char*,...);
39 intptr_t __cdecl _execv(const char*,char* const *);
40 intptr_t __cdecl _execve(const char*,char* const *,const char* const *);
41 intptr_t __cdecl _execvp(const char*,char* const *);
42 intptr_t __cdecl _execvpe(const char*,char* const *,const char* const *);
43 int __cdecl _getpid(void);
44 intptr_t __cdecl _spawnl(int,const char*,const char*,...);
45 intptr_t __cdecl _spawnle(int,const char*,const char*,...);
46 intptr_t __cdecl _spawnlp(int,const char*,const char*,...);
47 intptr_t __cdecl _spawnlpe(int,const char*,const char*,...);
48 intptr_t __cdecl _spawnv(int,const char*,const char* const *);
49 intptr_t __cdecl _spawnve(int,const char*,const char* const *,const char* const *);
50 intptr_t __cdecl _spawnvp(int,const char*,const char* const *);
51 intptr_t __cdecl _spawnvpe(int,const char*,const char* const *,const char* const *);
53 void __cdecl _c_exit(void);
54 void __cdecl _cexit(void);
55 void __cdecl _exit(int);
56 void __cdecl abort(void);
57 void __cdecl exit(int);
58 int __cdecl system(const char*);
60 #ifndef _WPROCESS_DEFINED
61 #define _WPROCESS_DEFINED
62 intptr_t __cdecl _wexecl(const wchar_t*,const wchar_t*,...);
63 intptr_t __cdecl _wexecle(const wchar_t*,const wchar_t*,...);
64 intptr_t __cdecl _wexeclp(const wchar_t*,const wchar_t*,...);
65 intptr_t __cdecl _wexeclpe(const wchar_t*,const wchar_t*,...);
66 intptr_t __cdecl _wexecv(const wchar_t*,const wchar_t* const *);
67 intptr_t __cdecl _wexecve(const wchar_t*,const wchar_t* const *,const wchar_t* const *);
68 intptr_t __cdecl _wexecvp(const wchar_t*,const wchar_t* const *);
69 intptr_t __cdecl _wexecvpe(const wchar_t*,const wchar_t* const *,const wchar_t* const *);
70 intptr_t __cdecl _wspawnl(int,const wchar_t*,const wchar_t*,...);
71 intptr_t __cdecl _wspawnle(int,const wchar_t*,const wchar_t*,...);
72 intptr_t __cdecl _wspawnlp(int,const wchar_t*,const wchar_t*,...);
73 intptr_t __cdecl _wspawnlpe(int,const wchar_t*,const wchar_t*,...);
74 intptr_t __cdecl _wspawnv(int,const wchar_t*,const wchar_t* const *);
75 intptr_t __cdecl _wspawnve(int,const wchar_t*,const wchar_t* const *,const wchar_t* const *);
76 intptr_t __cdecl _wspawnvp(int,const wchar_t*,const wchar_t* const *);
77 intptr_t __cdecl _wspawnvpe(int,const wchar_t*,const wchar_t* const *,const wchar_t* const *);
78 int __cdecl _wsystem(const wchar_t*);
79 #endif /* _WPROCESS_DEFINED */
86 #define P_WAIT _P_WAIT
87 #define P_NOWAIT _P_NOWAIT
88 #define P_OVERLAY _P_OVERLAY
89 #define P_NOWAITO _P_NOWAITO
90 #define P_DETACH _P_DETACH
92 #define WAIT_CHILD _WAIT_CHILD
93 #define WAIT_GRANDCHILD _WAIT_GRANDCHILD
95 static inline intptr_t cwait(int *status, intptr_t pid, int action) { return _cwait(status, pid, action); }
96 static inline int getpid(void) { return _getpid(); }
97 static inline intptr_t execv(const char* name, char* const* argv) { return _execv(name, argv); }
98 static inline intptr_t execve(const char* name, char* const* argv, const char* const* envv) { return _execve(name, argv, envv); }
99 static inline intptr_t execvp(const char* name, char* const* argv) { return _execvp(name, argv); }
100 static inline intptr_t execvpe(const char* name, char* const* argv, const char* const* envv) { return _execvpe(name, argv, envv); }
101 static inline intptr_t spawnv(int flags, const char* name, const char* const* argv) { return _spawnv(flags, name, argv); }
102 static inline intptr_t spawnve(int flags, const char* name, const char* const* argv, const char* const* envv) { return _spawnve(flags, name, argv, envv); }
103 static inline intptr_t spawnvp(int flags, const char* name, const char* const* argv) { return _spawnvp(flags, name, argv); }
104 static inline intptr_t spawnvpe(int flags, const char* name, const char* const* argv, const char* const* envv) { return _spawnvpe(flags, name, argv, envv); }
106 #if defined(__GNUC__) && (__GNUC__ < 4)
107 extern intptr_t __cdecl execl(const char*,const char*,...) __attribute__((alias("_execl")));
108 extern intptr_t __cdecl execle(const char*,const char*,...) __attribute__((alias("_execle")));
109 extern intptr_t __cdecl execlp(const char*,const char*,...) __attribute__((alias("_execlp")));
110 extern intptr_t __cdecl execlpe(const char*,const char*,...) __attribute__((alias("_execlpe")));
111 extern intptr_t __cdecl spawnl(int,const char*,const char*,...) __attribute__((alias("_spawnl")));
112 extern intptr_t __cdecl spawnle(int,const char*,const char*,...) __attribute__((alias("_spawnle")));
113 extern intptr_t __cdecl spawnlp(int,const char*,const char*,...) __attribute__((alias("_spawnlp")));
114 extern intptr_t __cdecl spawnlpe(int,const char*,const char*,...) __attribute__((alias("_spawnlpe")));
117 #define execle _execle
118 #define execlp _execlp
119 #define execlpe _execlpe
120 #define spawnl _spawnl
121 #define spawnle _spawnle
122 #define spawnlp _spawnlp
123 #define spawnlpe _spawnlpe
124 #endif /* __GNUC__ */
126 #endif /* __WINE_PROCESS_H */