2000-02-18 03:38:33 +08:00
|
|
|
/*
|
|
|
|
* process.h
|
2004-04-21 06:49:32 +08:00
|
|
|
* This file has no copyright assigned and is placed in the Public Domain.
|
|
|
|
* This file is a part of the mingw-runtime package.
|
|
|
|
* No warranty is given; refer to the file DISCLAIMER within the package.
|
2000-02-18 03:38:33 +08:00
|
|
|
*
|
|
|
|
* Function calls for spawning child processes.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _PROCESS_H_
|
|
|
|
#define _PROCESS_H_
|
|
|
|
|
|
|
|
/* All the headers include this file. */
|
|
|
|
#include <_mingw.h>
|
|
|
|
|
2008-04-25 Danny Smith <dannysmith@users.sourceforge.net>
* include/process.h: Include stdint.h for intptr_t definition.
(_execl, _execle, _execlp, _execlpe, _execv, _execve, _execvp, _execvpe,
_spawnl, _spawnle, _spawnlp, _spawnlpe, _spawnv, _spawnve, _spawnvp,
_spawnvpe): Return intptr_t.
(execl, execle, execlp, execlpe, execv, execve, execvp, execvpe, spawnl,
spawnle, spawnlp, spawnlpe, spawnv, spawnve, spawnvp, spawnvpe): Return
intptr_t.
[!_WPROCESS_DEFINED]: Include stdint.h for intptr_t definition.
(_wexecl, _wexecle, _wexeclp, _wexeclpe, _wexecv, _wexecve, _wexecvp,
_wexecvpe, _wspawnl, _wspawnle, _wspawnlp, _wspawnlpe, _wspawnv, _wspawnve,
_wspawnvp, _wspawnvpe): Return intptr_t.
2008-04-26 08:24:19 +08:00
|
|
|
#include <sys/types.h> /* For _pid_t and pid_t. */
|
|
|
|
#include <stdint.h> /* For intptr_t. */
|
2000-02-18 03:38:33 +08:00
|
|
|
/*
|
|
|
|
* Constants for cwait actions.
|
|
|
|
* Obsolete for Win32.
|
|
|
|
*/
|
|
|
|
#define _WAIT_CHILD 0
|
|
|
|
#define _WAIT_GRANDCHILD 1
|
|
|
|
|
|
|
|
#ifndef _NO_OLDNAMES
|
|
|
|
#define WAIT_CHILD _WAIT_CHILD
|
|
|
|
#define WAIT_GRANDCHILD _WAIT_GRANDCHILD
|
|
|
|
#endif /* Not _NO_OLDNAMES */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Mode constants for spawn functions.
|
|
|
|
*/
|
|
|
|
#define _P_WAIT 0
|
|
|
|
#define _P_NOWAIT 1
|
|
|
|
#define _P_OVERLAY 2
|
|
|
|
#define _OLD_P_OVERLAY _P_OVERLAY
|
|
|
|
#define _P_NOWAITO 3
|
|
|
|
#define _P_DETACH 4
|
|
|
|
|
|
|
|
#ifndef _NO_OLDNAMES
|
|
|
|
#define P_WAIT _P_WAIT
|
|
|
|
#define P_NOWAIT _P_NOWAIT
|
|
|
|
#define P_OVERLAY _P_OVERLAY
|
|
|
|
#define OLD_P_OVERLAY _OLD_P_OVERLAY
|
|
|
|
#define P_NOWAITO _P_NOWAITO
|
|
|
|
#define P_DETACH _P_DETACH
|
|
|
|
#endif /* Not _NO_OLDNAMES */
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef RC_INVOKED
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2007-06-23 15:34:16 +08:00
|
|
|
_CRTIMP void __cdecl __MINGW_NOTHROW _cexit(void);
|
|
|
|
_CRTIMP void __cdecl __MINGW_NOTHROW _c_exit(void);
|
2003-02-11 05:13:34 +08:00
|
|
|
|
2007-06-23 15:34:16 +08:00
|
|
|
_CRTIMP int __cdecl __MINGW_NOTHROW _cwait (int*, _pid_t, int);
|
2003-02-11 05:13:34 +08:00
|
|
|
|
2007-06-23 15:34:16 +08:00
|
|
|
_CRTIMP _pid_t __cdecl __MINGW_NOTHROW _getpid(void);
|
2003-02-11 05:13:34 +08:00
|
|
|
|
2008-04-25 Danny Smith <dannysmith@users.sourceforge.net>
* include/process.h: Include stdint.h for intptr_t definition.
(_execl, _execle, _execlp, _execlpe, _execv, _execve, _execvp, _execvpe,
_spawnl, _spawnle, _spawnlp, _spawnlpe, _spawnv, _spawnve, _spawnvp,
_spawnvpe): Return intptr_t.
(execl, execle, execlp, execlpe, execv, execve, execvp, execvpe, spawnl,
spawnle, spawnlp, spawnlpe, spawnv, spawnve, spawnvp, spawnvpe): Return
intptr_t.
[!_WPROCESS_DEFINED]: Include stdint.h for intptr_t definition.
(_wexecl, _wexecle, _wexeclp, _wexeclpe, _wexecv, _wexecve, _wexecvp,
_wexecvpe, _wspawnl, _wspawnle, _wspawnlp, _wspawnlpe, _wspawnv, _wspawnve,
_wspawnvp, _wspawnvpe): Return intptr_t.
2008-04-26 08:24:19 +08:00
|
|
|
_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _execl (const char*, const char*, ...);
|
|
|
|
_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _execle (const char*, const char*, ...);
|
|
|
|
_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _execlp (const char*, const char*, ...);
|
|
|
|
_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _execlpe (const char*, const char*, ...);
|
|
|
|
_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _execv (const char*, const char* const*);
|
|
|
|
_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _execve (const char*, const char* const*, const char* const*);
|
|
|
|
_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _execvp (const char*, const char* const*);
|
|
|
|
_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _execvpe (const char*, const char* const*, const char* const*);
|
|
|
|
|
|
|
|
_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _spawnl (int, const char*, const char*, ...);
|
|
|
|
_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _spawnle (int, const char*, const char*, ...);
|
|
|
|
_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _spawnlp (int, const char*, const char*, ...);
|
|
|
|
_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _spawnlpe (int, const char*, const char*, ...);
|
|
|
|
_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _spawnv (int, const char*, const char* const*);
|
|
|
|
_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _spawnve (int, const char*, const char* const*, const char* const*);
|
|
|
|
_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _spawnvp (int, const char*, const char* const*);
|
|
|
|
_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _spawnvpe (int, const char*, const char* const*, const char* const*);
|
* include/process.h (_execv, _execvp, _spawnv, _spawnvp, _execve,
_execvpe, _spawnve, _spawnvpe, execv, execvp, spawnv, spawnvp,
execve, execvpe, spawnve, spawnvpe): Const-ify all the char params.
2003-07-03 06:09:25 +08:00
|
|
|
|
2000-02-18 03:38:33 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* The functions _beginthreadex and _endthreadex are not provided by CRTDLL.
|
|
|
|
* They are provided by MSVCRT.
|
|
|
|
*
|
|
|
|
* NOTE: Apparently _endthread calls CloseHandle on the handle of the thread,
|
|
|
|
* making for race conditions if you are not careful. Basically you have to
|
|
|
|
* make sure that no-one is going to do *anything* with the thread handle
|
|
|
|
* after the thread calls _endthread or returns from the thread function.
|
|
|
|
*
|
|
|
|
* NOTE: No old names for these functions. Use the underscore.
|
|
|
|
*/
|
2007-06-23 15:34:16 +08:00
|
|
|
_CRTIMP unsigned long __cdecl __MINGW_NOTHROW
|
2000-02-18 03:38:33 +08:00
|
|
|
_beginthread (void (*)(void *), unsigned, void*);
|
2007-06-23 15:34:16 +08:00
|
|
|
_CRTIMP void __cdecl __MINGW_NOTHROW _endthread (void);
|
2000-02-18 03:38:33 +08:00
|
|
|
|
|
|
|
#ifdef __MSVCRT__
|
2007-06-23 15:34:16 +08:00
|
|
|
_CRTIMP unsigned long __cdecl __MINGW_NOTHROW
|
2000-02-18 03:38:33 +08:00
|
|
|
_beginthreadex (void *, unsigned, unsigned (__stdcall *) (void *),
|
|
|
|
void*, unsigned, unsigned*);
|
2007-06-23 15:34:16 +08:00
|
|
|
_CRTIMP void __cdecl __MINGW_NOTHROW _endthreadex (unsigned);
|
2000-02-18 03:38:33 +08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef _NO_OLDNAMES
|
|
|
|
/*
|
|
|
|
* Functions without the leading underscore, for portability. These functions
|
|
|
|
* live in liboldnames.a.
|
|
|
|
*/
|
2007-06-23 15:34:16 +08:00
|
|
|
_CRTIMP int __cdecl __MINGW_NOTHROW cwait (int*, pid_t, int);
|
|
|
|
_CRTIMP pid_t __cdecl __MINGW_NOTHROW getpid (void);
|
2008-04-25 Danny Smith <dannysmith@users.sourceforge.net>
* include/process.h: Include stdint.h for intptr_t definition.
(_execl, _execle, _execlp, _execlpe, _execv, _execve, _execvp, _execvpe,
_spawnl, _spawnle, _spawnlp, _spawnlpe, _spawnv, _spawnve, _spawnvp,
_spawnvpe): Return intptr_t.
(execl, execle, execlp, execlpe, execv, execve, execvp, execvpe, spawnl,
spawnle, spawnlp, spawnlpe, spawnv, spawnve, spawnvp, spawnvpe): Return
intptr_t.
[!_WPROCESS_DEFINED]: Include stdint.h for intptr_t definition.
(_wexecl, _wexecle, _wexeclp, _wexeclpe, _wexecv, _wexecve, _wexecvp,
_wexecvpe, _wspawnl, _wspawnle, _wspawnlp, _wspawnlpe, _wspawnv, _wspawnve,
_wspawnvp, _wspawnvpe): Return intptr_t.
2008-04-26 08:24:19 +08:00
|
|
|
|
|
|
|
_CRTIMP intptr_t __cdecl __MINGW_NOTHROW execl (const char*, const char*, ...);
|
|
|
|
_CRTIMP intptr_t __cdecl __MINGW_NOTHROW execle (const char*, const char*, ...);
|
|
|
|
_CRTIMP intptr_t __cdecl __MINGW_NOTHROW execlp (const char*, const char*, ...);
|
|
|
|
_CRTIMP intptr_t __cdecl __MINGW_NOTHROW execlpe (const char*, const char*,...);
|
|
|
|
_CRTIMP intptr_t __cdecl __MINGW_NOTHROW execv (const char*, const char* const*);
|
|
|
|
_CRTIMP intptr_t __cdecl __MINGW_NOTHROW execve (const char*, const char* const*, const char* const*);
|
|
|
|
_CRTIMP intptr_t __cdecl __MINGW_NOTHROW execvp (const char*, const char* const*);
|
|
|
|
_CRTIMP intptr_t __cdecl __MINGW_NOTHROW execvpe (const char*, const char* const*, const char* const*);
|
|
|
|
|
|
|
|
_CRTIMP intptr_t __cdecl __MINGW_NOTHROW spawnl (int, const char*, const char*, ...);
|
|
|
|
_CRTIMP intptr_t __cdecl __MINGW_NOTHROW spawnle (int, const char*, const char*, ...);
|
|
|
|
_CRTIMP intptr_t __cdecl __MINGW_NOTHROW spawnlp (int, const char*, const char*, ...);
|
|
|
|
_CRTIMP intptr_t __cdecl __MINGW_NOTHROW spawnlpe (int, const char*, const char*, ...);
|
|
|
|
_CRTIMP intptr_t __cdecl __MINGW_NOTHROW spawnv (int, const char*, const char* const*);
|
|
|
|
_CRTIMP intptr_t __cdecl __MINGW_NOTHROW spawnve (int, const char*, const char* const*, const char* const*);
|
|
|
|
_CRTIMP intptr_t __cdecl __MINGW_NOTHROW spawnvp (int, const char*, const char* const*);
|
|
|
|
_CRTIMP intptr_t __cdecl __MINGW_NOTHROW spawnvpe (int, const char*, const char* const*, const char* const*);
|
2000-02-18 03:38:33 +08:00
|
|
|
#endif /* Not _NO_OLDNAMES */
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* Not RC_INVOKED */
|
|
|
|
|
|
|
|
#endif /* _PROCESS_H_ not defined */
|