PageRenderTime 47ms CodeModel.GetById 30ms app.highlight 14ms RepoModel.GetById 1ms app.codeStats 0ms

/include/process.h

https://bitbucket.org/stden/mingw
C Header | 139 lines | 83 code | 24 blank | 32 comment | 0 complexity | b5e0af23f722c6937af068af203cebb6 MD5 | raw file
  1/* 
  2 * process.h
  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.
  6 *
  7 * Function calls for spawning child processes.
  8 *
  9 */
 10
 11#ifndef	_PROCESS_H_
 12#define	_PROCESS_H_
 13
 14/* All the headers include this file. */
 15#include <_mingw.h>
 16
 17#include <sys/types.h> /* For _pid_t and pid_t. */
 18#include <stdint.h>  /* For intptr_t. */
 19/*
 20 * Constants for cwait actions.
 21 * Obsolete for Win32.
 22 */
 23#define	_WAIT_CHILD		0
 24#define	_WAIT_GRANDCHILD	1
 25
 26#ifndef	_NO_OLDNAMES
 27#define	WAIT_CHILD		_WAIT_CHILD
 28#define	WAIT_GRANDCHILD		_WAIT_GRANDCHILD
 29#endif	/* Not _NO_OLDNAMES */
 30
 31/*
 32 * Mode constants for spawn functions.
 33 */
 34#define	_P_WAIT		0
 35#define	_P_NOWAIT	1
 36#define	_P_OVERLAY	2
 37#define	_OLD_P_OVERLAY	_P_OVERLAY
 38#define	_P_NOWAITO	3
 39#define	_P_DETACH	4
 40
 41#ifndef	_NO_OLDNAMES
 42#define	P_WAIT		_P_WAIT
 43#define	P_NOWAIT	_P_NOWAIT
 44#define	P_OVERLAY	_P_OVERLAY
 45#define	OLD_P_OVERLAY	_OLD_P_OVERLAY
 46#define	P_NOWAITO	_P_NOWAITO
 47#define	P_DETACH	_P_DETACH
 48#endif	/* Not _NO_OLDNAMES */
 49
 50
 51#ifndef RC_INVOKED
 52
 53#ifdef	__cplusplus
 54extern "C" {
 55#endif
 56
 57_CRTIMP void __cdecl __MINGW_NOTHROW _cexit(void);
 58_CRTIMP void __cdecl __MINGW_NOTHROW _c_exit(void);
 59
 60_CRTIMP int __cdecl __MINGW_NOTHROW _cwait (int*, _pid_t, int);
 61
 62_CRTIMP _pid_t __cdecl __MINGW_NOTHROW _getpid(void);
 63
 64_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _execl	(const char*, const char*, ...);
 65_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _execle	(const char*, const char*, ...);
 66_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _execlp	(const char*, const char*, ...);
 67_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _execlpe	(const char*, const char*, ...);
 68_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _execv	(const char*, const char* const*);
 69_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _execve	(const char*, const char* const*, const char* const*);
 70_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _execvp	(const char*, const char* const*);
 71_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _execvpe	(const char*, const char* const*, const char* const*);
 72
 73_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _spawnl	(int, const char*, const char*, ...);
 74_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _spawnle	(int, const char*, const char*, ...);
 75_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _spawnlp	(int, const char*, const char*, ...);
 76_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _spawnlpe	(int, const char*, const char*, ...);
 77_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _spawnv	(int, const char*, const char* const*);
 78_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _spawnve	(int, const char*, const char* const*, const char* const*);
 79_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _spawnvp	(int, const char*, const char* const*);
 80_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _spawnvpe	(int, const char*, const char* const*, const char* const*);
 81
 82
 83/*
 84 * The functions _beginthreadex and _endthreadex are not provided by CRTDLL.
 85 * They are provided by MSVCRT.
 86 *
 87 * NOTE: Apparently _endthread calls CloseHandle on the handle of the thread,
 88 * making for race conditions if you are not careful. Basically you have to
 89 * make sure that no-one is going to do *anything* with the thread handle
 90 * after the thread calls _endthread or returns from the thread function.
 91 *
 92 * NOTE: No old names for these functions. Use the underscore.
 93 */
 94_CRTIMP unsigned long __cdecl __MINGW_NOTHROW
 95	_beginthread	(void (*)(void *), unsigned, void*);
 96_CRTIMP void __cdecl __MINGW_NOTHROW _endthread	(void);
 97
 98#ifdef	__MSVCRT__
 99_CRTIMP unsigned long __cdecl __MINGW_NOTHROW
100	_beginthreadex	(void *, unsigned, unsigned (__stdcall *) (void *), 
101			 void*, unsigned, unsigned*);
102_CRTIMP void __cdecl __MINGW_NOTHROW _endthreadex (unsigned);
103#endif
104
105
106#ifndef	_NO_OLDNAMES
107/*
108 * Functions without the leading underscore, for portability. These functions
109 * live in liboldnames.a.
110 */
111_CRTIMP int  __cdecl __MINGW_NOTHROW cwait (int*, pid_t, int);
112_CRTIMP pid_t __cdecl __MINGW_NOTHROW getpid (void);
113
114_CRTIMP intptr_t __cdecl __MINGW_NOTHROW execl	(const char*, const char*, ...);
115_CRTIMP intptr_t __cdecl __MINGW_NOTHROW execle	(const char*, const char*, ...);
116_CRTIMP intptr_t __cdecl __MINGW_NOTHROW execlp	(const char*, const char*, ...);
117_CRTIMP intptr_t __cdecl __MINGW_NOTHROW execlpe	(const char*, const char*,...);
118_CRTIMP intptr_t __cdecl __MINGW_NOTHROW execv	(const char*, const char* const*);
119_CRTIMP intptr_t __cdecl __MINGW_NOTHROW execve	(const char*, const char* const*, const char* const*);
120_CRTIMP intptr_t __cdecl __MINGW_NOTHROW execvp	(const char*, const char* const*);
121_CRTIMP intptr_t __cdecl __MINGW_NOTHROW execvpe	(const char*, const char* const*, const char* const*);
122
123_CRTIMP intptr_t __cdecl __MINGW_NOTHROW spawnl	(int, const char*, const char*, ...);
124_CRTIMP intptr_t __cdecl __MINGW_NOTHROW spawnle	(int, const char*, const char*, ...);
125_CRTIMP intptr_t __cdecl __MINGW_NOTHROW spawnlp	(int, const char*, const char*, ...);
126_CRTIMP intptr_t __cdecl __MINGW_NOTHROW spawnlpe	(int, const char*, const char*, ...);
127_CRTIMP intptr_t __cdecl __MINGW_NOTHROW spawnv	(int, const char*, const char* const*);
128_CRTIMP intptr_t __cdecl __MINGW_NOTHROW spawnve	(int, const char*, const char* const*, const char* const*);
129_CRTIMP intptr_t __cdecl __MINGW_NOTHROW spawnvp	(int, const char*, const char* const*);
130_CRTIMP intptr_t __cdecl __MINGW_NOTHROW spawnvpe	(int, const char*, const char* const*, const char* const*);
131#endif	/* Not _NO_OLDNAMES */
132
133#ifdef	__cplusplus
134}
135#endif
136
137#endif	/* Not RC_INVOKED */
138
139#endif	/* _PROCESS_H_ not defined */