4 * Function calls for spawning child processes.
6 * This file is part of the Mingw32 package.
9 * Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
11 * THIS SOFTWARE IS NOT COPYRIGHTED
13 * This source code is offered for use in the public domain. You may
14 * use, modify or distribute it freely.
16 * This code is distributed in the hope that it will be useful but
17 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
18 * DISCLAMED. This includes but is not limited to warranties of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
23 * $Date: 1999/04/02 21:42:06 $
26 /* Appropriated for Reactos Crtdll by Ariadne */
27 /* changed second argument of cwait from nPID to hProc */
32 #ifndef __STRICT_ANSI__
42 * Constants for cwait actions.
46 #define _WAIT_GRANDCHILD 1
49 #define WAIT_CHILD _WAIT_CHILD
50 #define WAIT_GRANDCHILD _WAIT_GRANDCHILD
51 #endif /* Not _NO_OLDNAMES */
53 int _cwait (int* pnStatus
, int hProc
, int nAction
);
57 int _execl (const char* szPath
, const char* szArgv0
, ...);
58 int _execle (const char* szPath
, const char* szArgv0
, ...);
59 int _execlp (const char* szPath
, const char* szArgv0
, ...);
60 int _execlpe (const char* szPath
, const char* szArgv0
, ...);
61 int _execv (const char* szPath
, char* const* szaArgv
);
62 int _execve (const char* szPath
, char* const* szaArgv
, char* const* szaEnv
);
63 int _execvp (const char* szPath
, char* const* szaArgv
);
64 int _execvpe (const char* szPath
, char* const* szaArgv
, char* const* szaEnv
);
68 * Mode constants for spawn functions.
73 #define _OLD_P_OVERLAY _P_OVERLAY
78 #define P_WAIT _P_WAIT
79 #define P_NOWAIT _P_NOWAIT
80 #define P_OVERLAY _P_OVERLAY
81 #define OLD_P_OVERLAY _OLD_P_OVERLAY
82 #define P_NOWAITO _P_NOWAITO
83 #define P_DETACH _P_DETACH
84 #endif /* Not _NO_OLDNAMES */
86 int _spawnl (int nMode
, const char* szPath
, const char* szArgv0
, ...);
87 int _spawnle (int nMode
, const char* szPath
, const char* szArgv0
,...);
88 int _spawnlp (int nMode
, const char* szPath
, const char* szArgv0
,...);
89 int _spawnlpe (int nMode
, const char* szPath
, const char* szArgv0
,...);
90 int _spawnv (int nMode
, const char* szPath
, char* const* szaArgv
);
91 int _spawnve (int nMode
, const char* szPath
, char* const* szaArgv
, char* const* szaEnv
);
92 int _spawnvp (int nMode
, const char* szPath
, char* const* szaArgv
);
93 int _spawnvpe (int nMode
, const char* szPath
, char* const* szaArgv
, char* const* szaEnv
);
95 * The functions _beginthreadex and _endthreadex are not provided by CRTDLL.
96 * They are provided by MSVCRT.
98 * NOTE: Apparently _endthread calls CloseHandle on the handle of the thread,
99 * making for race conditions if you are not careful. Basically you have to
100 * make sure that no-one is going to do *anything* with the thread handle
101 * after the thread calls _endthread or returns from the thread function.
103 * NOTE: No old names for these functions. Use the underscore.
106 _beginthread (void (*pfuncStart
)(void *),
107 unsigned unStackSize
, void* pArgList
);
108 void _endthread (void);
112 _beginthreadex (void *pSecurity
, unsigned unStackSize
,
113 unsigned (*pfuncStart
)(void*), void* pArgList
,
114 unsigned unInitFlags
, unsigned* pThreadAddr
);
115 void _endthreadex (unsigned unExitCode
);
119 void *_loaddll (char *name
);
120 int _unloaddll(void *handle
);
122 unsigned long __threadid(void);
123 #define _threadid __threadid()
124 void * __threadhandle(void);
130 #define getpid _getpid
132 #define execle _execle
133 #define execlp _execlp
134 #define execlpe _execlpe
137 #define execve _execve
138 #define execvp _execvp
139 #define execvpe _execvpe
141 #define spawnl _spawnl
142 #define spawnle _spawnle
143 #define spawnlp _spawnlp
144 #define spawnlpe _spawnlpe
146 #define spawnv _spawnv
147 #define spawnve _spawnve
148 #define spawnvp _spawnvp
149 #define spawnvpe _spawnvpe
152 #endif /* Not _NO_OLDNAMES */
158 #endif /* Not __STRICT_ANSI__ */
160 #endif /* _PROCESS_H_ not defined */