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 /* Includes a definition of _pid_t and pid_t */
18 #include <sys/types.h>
21 * Constants for cwait actions.
25 #define _WAIT_GRANDCHILD 1
28 #define WAIT_CHILD _WAIT_CHILD
29 #define WAIT_GRANDCHILD _WAIT_GRANDCHILD
30 #endif /* Not _NO_OLDNAMES */
33 * Mode constants for spawn functions.
38 #define _OLD_P_OVERLAY _P_OVERLAY
43 #define P_WAIT _P_WAIT
44 #define P_NOWAIT _P_NOWAIT
45 #define P_OVERLAY _P_OVERLAY
46 #define OLD_P_OVERLAY _OLD_P_OVERLAY
47 #define P_NOWAITO _P_NOWAITO
48 #define P_DETACH _P_DETACH
49 #endif /* Not _NO_OLDNAMES */
58 _CRTIMP
void __cdecl
_cexit(void);
59 _CRTIMP
void __cdecl
_c_exit(void);
61 _CRTIMP
int __cdecl
_cwait (int*, _pid_t
, int);
63 _CRTIMP _pid_t __cdecl
_getpid(void);
65 _CRTIMP
int __cdecl
_execl (const char*, const char*, ...);
66 _CRTIMP
int __cdecl
_execle (const char*, const char*, ...);
67 _CRTIMP
int __cdecl
_execlp (const char*, const char*, ...);
68 _CRTIMP
int __cdecl
_execlpe (const char*, const char*, ...);
69 _CRTIMP
int __cdecl
_execv (const char*, const char* const*);
70 _CRTIMP
int __cdecl
_execve (const char*, const char* const*, const char* const*);
71 _CRTIMP
int __cdecl
_execvp (const char*, const char* const*);
72 _CRTIMP
int __cdecl
_execvpe (const char*, const char* const*, const char* const*);
74 _CRTIMP
int __cdecl
_spawnl (int, const char*, const char*, ...);
75 _CRTIMP
int __cdecl
_spawnle (int, const char*, const char*, ...);
76 _CRTIMP
int __cdecl
_spawnlp (int, const char*, const char*, ...);
77 _CRTIMP
int __cdecl
_spawnlpe (int, const char*, const char*, ...);
78 _CRTIMP
int __cdecl
_spawnv (int, const char*, const char* const*);
79 _CRTIMP
int __cdecl
_spawnve (int, const char*, const char* const*, const char* const*);
80 _CRTIMP
int __cdecl
_spawnvp (int, const char*, const char* const*);
81 _CRTIMP
int __cdecl
_spawnvpe (int, const char*, const char* const*, const char* const*);
85 * The functions _beginthreadex and _endthreadex are not provided by CRTDLL.
86 * They are provided by MSVCRT.
88 * NOTE: Apparently _endthread calls CloseHandle on the handle of the thread,
89 * making for race conditions if you are not careful. Basically you have to
90 * make sure that no-one is going to do *anything* with the thread handle
91 * after the thread calls _endthread or returns from the thread function.
93 * NOTE: No old names for these functions. Use the underscore.
95 _CRTIMP
unsigned long __cdecl
96 _beginthread (void (*)(void *), unsigned, void*);
97 _CRTIMP
void __cdecl
_endthread (void);
100 _CRTIMP
unsigned long __cdecl
101 _beginthreadex (void *, unsigned, unsigned (__stdcall
*) (void *),
102 void*, unsigned, unsigned*);
103 _CRTIMP
void __cdecl
_endthreadex (unsigned);
109 * Functions without the leading underscore, for portability. These functions
110 * live in liboldnames.a.
112 _CRTIMP
int __cdecl
cwait (int*, pid_t
, int);
113 _CRTIMP pid_t __cdecl
getpid (void);
114 _CRTIMP
int __cdecl
execl (const char*, const char*, ...);
115 _CRTIMP
int __cdecl
execle (const char*, const char*, ...);
116 _CRTIMP
int __cdecl
execlp (const char*, const char*, ...);
117 _CRTIMP
int __cdecl
execlpe (const char*, const char*, ...);
118 _CRTIMP
int __cdecl
execv (const char*, const char* const*);
119 _CRTIMP
int __cdecl
execve (const char*, const char* const*, const char* const*);
120 _CRTIMP
int __cdecl
execvp (const char*, const char* const*);
121 _CRTIMP
int __cdecl
execvpe (const char*, const char* const*, const char* const*);
122 _CRTIMP
int __cdecl
spawnl (int, const char*, const char*, ...);
123 _CRTIMP
int __cdecl
spawnle (int, const char*, const char*, ...);
124 _CRTIMP
int __cdecl
spawnlp (int, const char*, const char*, ...);
125 _CRTIMP
int __cdecl
spawnlpe (int, const char*, const char*, ...);
126 _CRTIMP
int __cdecl
spawnv (int, const char*, const char* const*);
127 _CRTIMP
int __cdecl
spawnve (int, const char*, const char* const*, const char* const*);
128 _CRTIMP
int __cdecl
spawnvp (int, const char*, const char* const*);
129 _CRTIMP
int __cdecl
spawnvpe (int, const char*, const char* const*, const char* const*);
130 #endif /* Not _NO_OLDNAMES */
136 #endif /* Not RC_INVOKED */
138 #endif /* _PROCESS_H_ not defined */