1 | /*
|
---|
2 | * Process definitions
|
---|
3 | *
|
---|
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.
|
---|
7 | */
|
---|
8 |
|
---|
9 | /*
|
---|
10 | * Sun LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
|
---|
11 | * other than GPL or LGPL is available it will apply instead, Sun elects to use only
|
---|
12 | * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
|
---|
13 | * a choice of LGPL license versions is made available with the language indicating
|
---|
14 | * that LGPLv2 or any later version may be used, or where a choice of which version
|
---|
15 | * of the LGPL is applied is otherwise unspecified.
|
---|
16 | */
|
---|
17 |
|
---|
18 | #ifndef __WINE_PROCESS_H
|
---|
19 | #define __WINE_PROCESS_H
|
---|
20 |
|
---|
21 | #include <crtdefs.h>
|
---|
22 |
|
---|
23 | /* Process creation flags */
|
---|
24 | #define _P_WAIT 0
|
---|
25 | #define _P_NOWAIT 1
|
---|
26 | #define _P_OVERLAY 2
|
---|
27 | #define _P_NOWAITO 3
|
---|
28 | #define _P_DETACH 4
|
---|
29 |
|
---|
30 | #define _WAIT_CHILD 0
|
---|
31 | #define _WAIT_GRANDCHILD 1
|
---|
32 |
|
---|
33 | #ifdef __cplusplus
|
---|
34 | extern "C" {
|
---|
35 | #endif
|
---|
36 |
|
---|
37 | typedef void (__cdecl *_beginthread_start_routine_t)(void *);
|
---|
38 | typedef unsigned int (__stdcall *_beginthreadex_start_routine_t)(void *);
|
---|
39 |
|
---|
40 | uintptr_t __cdecl _beginthread(_beginthread_start_routine_t,unsigned int,void*);
|
---|
41 | uintptr_t __cdecl _beginthreadex(void*,unsigned int,_beginthreadex_start_routine_t,void*,unsigned int,unsigned int*);
|
---|
42 | intptr_t __cdecl _cwait(int*,intptr_t,int);
|
---|
43 | void __cdecl _endthread(void);
|
---|
44 | void __cdecl _endthreadex(unsigned int);
|
---|
45 | intptr_t __cdecl _execl(const char*,const char*,...);
|
---|
46 | intptr_t __cdecl _execle(const char*,const char*,...);
|
---|
47 | intptr_t __cdecl _execlp(const char*,const char*,...);
|
---|
48 | intptr_t __cdecl _execlpe(const char*,const char*,...);
|
---|
49 | intptr_t __cdecl _execv(const char*,char* const *);
|
---|
50 | intptr_t __cdecl _execve(const char*,char* const *,const char* const *);
|
---|
51 | intptr_t __cdecl _execvp(const char*,char* const *);
|
---|
52 | intptr_t __cdecl _execvpe(const char*,char* const *,const char* const *);
|
---|
53 | int __cdecl _getpid(void);
|
---|
54 | intptr_t __cdecl _spawnl(int,const char*,const char*,...);
|
---|
55 | intptr_t __cdecl _spawnle(int,const char*,const char*,...);
|
---|
56 | intptr_t __cdecl _spawnlp(int,const char*,const char*,...);
|
---|
57 | intptr_t __cdecl _spawnlpe(int,const char*,const char*,...);
|
---|
58 | intptr_t __cdecl _spawnv(int,const char*,const char* const *);
|
---|
59 | intptr_t __cdecl _spawnve(int,const char*,const char* const *,const char* const *);
|
---|
60 | intptr_t __cdecl _spawnvp(int,const char*,const char* const *);
|
---|
61 | intptr_t __cdecl _spawnvpe(int,const char*,const char* const *,const char* const *);
|
---|
62 |
|
---|
63 | void __cdecl _c_exit(void);
|
---|
64 | void __cdecl _cexit(void);
|
---|
65 | void __cdecl _exit(int);
|
---|
66 | void __cdecl abort(void);
|
---|
67 | void __cdecl exit(int);
|
---|
68 | int __cdecl system(const char*);
|
---|
69 |
|
---|
70 | #ifndef _WPROCESS_DEFINED
|
---|
71 | #define _WPROCESS_DEFINED
|
---|
72 | intptr_t __cdecl _wexecl(const wchar_t*,const wchar_t*,...);
|
---|
73 | intptr_t __cdecl _wexecle(const wchar_t*,const wchar_t*,...);
|
---|
74 | intptr_t __cdecl _wexeclp(const wchar_t*,const wchar_t*,...);
|
---|
75 | intptr_t __cdecl _wexeclpe(const wchar_t*,const wchar_t*,...);
|
---|
76 | intptr_t __cdecl _wexecv(const wchar_t*,const wchar_t* const *);
|
---|
77 | intptr_t __cdecl _wexecve(const wchar_t*,const wchar_t* const *,const wchar_t* const *);
|
---|
78 | intptr_t __cdecl _wexecvp(const wchar_t*,const wchar_t* const *);
|
---|
79 | intptr_t __cdecl _wexecvpe(const wchar_t*,const wchar_t* const *,const wchar_t* const *);
|
---|
80 | intptr_t __cdecl _wspawnl(int,const wchar_t*,const wchar_t*,...);
|
---|
81 | intptr_t __cdecl _wspawnle(int,const wchar_t*,const wchar_t*,...);
|
---|
82 | intptr_t __cdecl _wspawnlp(int,const wchar_t*,const wchar_t*,...);
|
---|
83 | intptr_t __cdecl _wspawnlpe(int,const wchar_t*,const wchar_t*,...);
|
---|
84 | intptr_t __cdecl _wspawnv(int,const wchar_t*,const wchar_t* const *);
|
---|
85 | intptr_t __cdecl _wspawnve(int,const wchar_t*,const wchar_t* const *,const wchar_t* const *);
|
---|
86 | intptr_t __cdecl _wspawnvp(int,const wchar_t*,const wchar_t* const *);
|
---|
87 | intptr_t __cdecl _wspawnvpe(int,const wchar_t*,const wchar_t* const *,const wchar_t* const *);
|
---|
88 | int __cdecl _wsystem(const wchar_t*);
|
---|
89 | #endif /* _WPROCESS_DEFINED */
|
---|
90 |
|
---|
91 | #ifdef __cplusplus
|
---|
92 | }
|
---|
93 | #endif
|
---|
94 |
|
---|
95 |
|
---|
96 | #define P_WAIT _P_WAIT
|
---|
97 | #define P_NOWAIT _P_NOWAIT
|
---|
98 | #define P_OVERLAY _P_OVERLAY
|
---|
99 | #define P_NOWAITO _P_NOWAITO
|
---|
100 | #define P_DETACH _P_DETACH
|
---|
101 |
|
---|
102 | #define WAIT_CHILD _WAIT_CHILD
|
---|
103 | #define WAIT_GRANDCHILD _WAIT_GRANDCHILD
|
---|
104 |
|
---|
105 | static inline intptr_t cwait(int *status, intptr_t pid, int action) { return _cwait(status, pid, action); }
|
---|
106 | static inline int getpid(void) { return _getpid(); }
|
---|
107 | static inline intptr_t execv(const char* name, char* const* argv) { return _execv(name, argv); }
|
---|
108 | static inline intptr_t execve(const char* name, char* const* argv, const char* const* envv) { return _execve(name, argv, envv); }
|
---|
109 | static inline intptr_t execvp(const char* name, char* const* argv) { return _execvp(name, argv); }
|
---|
110 | static inline intptr_t execvpe(const char* name, char* const* argv, const char* const* envv) { return _execvpe(name, argv, envv); }
|
---|
111 | static inline intptr_t spawnv(int flags, const char* name, const char* const* argv) { return _spawnv(flags, name, argv); }
|
---|
112 | static inline intptr_t spawnve(int flags, const char* name, const char* const* argv, const char* const* envv) { return _spawnve(flags, name, argv, envv); }
|
---|
113 | static inline intptr_t spawnvp(int flags, const char* name, const char* const* argv) { return _spawnvp(flags, name, argv); }
|
---|
114 | static inline intptr_t spawnvpe(int flags, const char* name, const char* const* argv, const char* const* envv) { return _spawnvpe(flags, name, argv, envv); }
|
---|
115 |
|
---|
116 | #if defined(__GNUC__) && (__GNUC__ < 4)
|
---|
117 | extern intptr_t __cdecl execl(const char*,const char*,...) __attribute__((alias("_execl")));
|
---|
118 | extern intptr_t __cdecl execle(const char*,const char*,...) __attribute__((alias("_execle")));
|
---|
119 | extern intptr_t __cdecl execlp(const char*,const char*,...) __attribute__((alias("_execlp")));
|
---|
120 | extern intptr_t __cdecl execlpe(const char*,const char*,...) __attribute__((alias("_execlpe")));
|
---|
121 | extern intptr_t __cdecl spawnl(int,const char*,const char*,...) __attribute__((alias("_spawnl")));
|
---|
122 | extern intptr_t __cdecl spawnle(int,const char*,const char*,...) __attribute__((alias("_spawnle")));
|
---|
123 | extern intptr_t __cdecl spawnlp(int,const char*,const char*,...) __attribute__((alias("_spawnlp")));
|
---|
124 | extern intptr_t __cdecl spawnlpe(int,const char*,const char*,...) __attribute__((alias("_spawnlpe")));
|
---|
125 | #else
|
---|
126 | #define execl _execl
|
---|
127 | #define execle _execle
|
---|
128 | #define execlp _execlp
|
---|
129 | #define execlpe _execlpe
|
---|
130 | #define spawnl _spawnl
|
---|
131 | #define spawnle _spawnle
|
---|
132 | #define spawnlp _spawnlp
|
---|
133 | #define spawnlpe _spawnlpe
|
---|
134 | #endif /* __GNUC__ */
|
---|
135 |
|
---|
136 | #endif /* __WINE_PROCESS_H */
|
---|