Home | History | Annotate | Download | only in include
      1 /**
      2  * This file has no copyright assigned and is placed in the Public Domain.
      3  * This file is part of the mingw-w64 runtime package.
      4  * No warranty is given; refer to the file DISCLAIMER.PD within this package.
      5  */
      6 #ifndef _INC_PROCESS
      7 #define _INC_PROCESS
      8 
      9 #include <crtdefs.h>
     10 
     11 /* Includes a definition of _pid_t and pid_t */
     12 #include <sys/types.h>
     13 
     14 #ifndef _POSIX_
     15 #ifdef __cplusplus
     16 extern "C" {
     17 #endif
     18 
     19 #define _P_WAIT 0
     20 #define _P_NOWAIT 1
     21 #define _OLD_P_OVERLAY 2
     22 #define _P_NOWAITO 3
     23 #define _P_DETACH 4
     24 #define _P_OVERLAY 2
     25 
     26 #define _WAIT_CHILD 0
     27 #define _WAIT_GRANDCHILD 1
     28 
     29   _CRTIMP uintptr_t __cdecl _beginthread(void (__cdecl *_StartAddress) (void *),unsigned _StackSize,void *_ArgList);
     30   _CRTIMP void __cdecl _endthread(void) __MINGW_ATTRIB_NORETURN;
     31   _CRTIMP uintptr_t __cdecl _beginthreadex(void *_Security,unsigned _StackSize,unsigned (__stdcall *_StartAddress) (void *),void *_ArgList,unsigned _InitFlag,unsigned *_ThrdAddr);
     32   _CRTIMP void __cdecl _endthreadex(unsigned _Retval) __MINGW_ATTRIB_NORETURN;
     33 
     34 #ifndef _CRT_TERMINATE_DEFINED
     35 #define _CRT_TERMINATE_DEFINED
     36   void __cdecl __MINGW_NOTHROW exit(int _Code) __MINGW_ATTRIB_NORETURN;
     37   void __cdecl __MINGW_NOTHROW _exit(int _Code) __MINGW_ATTRIB_NORETURN;
     38 
     39 #if !defined __NO_ISOCEXT /* extern stub in static libmingwex.a */
     40   /* C99 function name */
     41   void __cdecl _Exit(int) __MINGW_ATTRIB_NORETURN;
     42 #ifndef __CRT__NO_INLINE
     43   __CRT_INLINE __MINGW_ATTRIB_NORETURN void  __cdecl _Exit(int status)
     44   {  _exit(status); }
     45 #endif /* !__CRT__NO_INLINE */
     46 #endif /* Not  __NO_ISOCEXT */
     47 
     48 #pragma push_macro("abort")
     49 #undef abort
     50   void __cdecl __declspec(noreturn) abort(void);
     51 #pragma pop_macro("abort")
     52 
     53 #endif /* _CRT_TERMINATE_DEFINED */
     54 
     55   void __cdecl __MINGW_NOTHROW _cexit(void);
     56   void __cdecl __MINGW_NOTHROW _c_exit(void);
     57   _CRTIMP int __cdecl _getpid(void);
     58   _CRTIMP intptr_t __cdecl _cwait(int *_TermStat,intptr_t _ProcHandle,int _Action);
     59   _CRTIMP intptr_t __cdecl _execl(const char *_Filename,const char *_ArgList,...);
     60   _CRTIMP intptr_t __cdecl _execle(const char *_Filename,const char *_ArgList,...);
     61   _CRTIMP intptr_t __cdecl _execlp(const char *_Filename,const char *_ArgList,...);
     62   _CRTIMP intptr_t __cdecl _execlpe(const char *_Filename,const char *_ArgList,...);
     63   _CRTIMP intptr_t __cdecl _execv(const char *_Filename,const char *const *_ArgList);
     64   _CRTIMP intptr_t __cdecl _execve(const char *_Filename,const char *const *_ArgList,const char *const *_Env);
     65   _CRTIMP intptr_t __cdecl _execvp(const char *_Filename,const char *const *_ArgList);
     66   _CRTIMP intptr_t __cdecl _execvpe(const char *_Filename,const char *const *_ArgList,const char *const *_Env);
     67   _CRTIMP intptr_t __cdecl _spawnl(int _Mode,const char *_Filename,const char *_ArgList,...);
     68   _CRTIMP intptr_t __cdecl _spawnle(int _Mode,const char *_Filename,const char *_ArgList,...);
     69   _CRTIMP intptr_t __cdecl _spawnlp(int _Mode,const char *_Filename,const char *_ArgList,...);
     70   _CRTIMP intptr_t __cdecl _spawnlpe(int _Mode,const char *_Filename,const char *_ArgList,...);
     71   _CRTIMP intptr_t __cdecl _spawnv(int _Mode,const char *_Filename,const char *const *_ArgList);
     72   _CRTIMP intptr_t __cdecl _spawnve(int _Mode,const char *_Filename,const char *const *_ArgList,const char *const *_Env);
     73   _CRTIMP intptr_t __cdecl _spawnvp(int _Mode,const char *_Filename,const char *const *_ArgList);
     74   _CRTIMP intptr_t __cdecl _spawnvpe(int _Mode,const char *_Filename,const char *const *_ArgList,const char *const *_Env);
     75 
     76 #ifndef _CRT_SYSTEM_DEFINED
     77 #define _CRT_SYSTEM_DEFINED
     78   int __cdecl system(const char *_Command);
     79 #endif
     80 
     81 #ifndef _WPROCESS_DEFINED
     82 #define _WPROCESS_DEFINED
     83   _CRTIMP intptr_t __cdecl _wexecl(const wchar_t *_Filename,const wchar_t *_ArgList,...);
     84   _CRTIMP intptr_t __cdecl _wexecle(const wchar_t *_Filename,const wchar_t *_ArgList,...);
     85   _CRTIMP intptr_t __cdecl _wexeclp(const wchar_t *_Filename,const wchar_t *_ArgList,...);
     86   _CRTIMP intptr_t __cdecl _wexeclpe(const wchar_t *_Filename,const wchar_t *_ArgList,...);
     87   _CRTIMP intptr_t __cdecl _wexecv(const wchar_t *_Filename,const wchar_t *const *_ArgList);
     88   _CRTIMP intptr_t __cdecl _wexecve(const wchar_t *_Filename,const wchar_t *const *_ArgList,const wchar_t *const *_Env);
     89   _CRTIMP intptr_t __cdecl _wexecvp(const wchar_t *_Filename,const wchar_t *const *_ArgList);
     90   _CRTIMP intptr_t __cdecl _wexecvpe(const wchar_t *_Filename,const wchar_t *const *_ArgList,const wchar_t *const *_Env);
     91   _CRTIMP intptr_t __cdecl _wspawnl(int _Mode,const wchar_t *_Filename,const wchar_t *_ArgList,...);
     92   _CRTIMP intptr_t __cdecl _wspawnle(int _Mode,const wchar_t *_Filename,const wchar_t *_ArgList,...);
     93   _CRTIMP intptr_t __cdecl _wspawnlp(int _Mode,const wchar_t *_Filename,const wchar_t *_ArgList,...);
     94   _CRTIMP intptr_t __cdecl _wspawnlpe(int _Mode,const wchar_t *_Filename,const wchar_t *_ArgList,...);
     95   _CRTIMP intptr_t __cdecl _wspawnv(int _Mode,const wchar_t *_Filename,const wchar_t *const *_ArgList);
     96   _CRTIMP intptr_t __cdecl _wspawnve(int _Mode,const wchar_t *_Filename,const wchar_t *const *_ArgList,const wchar_t *const *_Env);
     97   _CRTIMP intptr_t __cdecl _wspawnvp(int _Mode,const wchar_t *_Filename,const wchar_t *const *_ArgList);
     98   _CRTIMP intptr_t __cdecl _wspawnvpe(int _Mode,const wchar_t *_Filename,const wchar_t *const *_ArgList,const wchar_t *const *_Env);
     99 #ifndef _CRT_WSYSTEM_DEFINED
    100 #define _CRT_WSYSTEM_DEFINED
    101   _CRTIMP int __cdecl _wsystem(const wchar_t *_Command);
    102 #endif
    103 #endif
    104 
    105   void __cdecl __security_init_cookie(void);
    106 #if (defined(_X86_) && !defined(__x86_64))
    107   void __fastcall __security_check_cookie(uintptr_t _StackCookie);
    108   __declspec(noreturn) void __cdecl __report_gsfailure(void);
    109 #else
    110   void __cdecl __security_check_cookie(uintptr_t _StackCookie);
    111   __declspec(noreturn) void __cdecl __report_gsfailure(uintptr_t _StackCookie);
    112 #endif
    113   extern uintptr_t __security_cookie;
    114 
    115   intptr_t __cdecl _loaddll(char *_Filename);
    116   int __cdecl _unloaddll(intptr_t _Handle);
    117   int (__cdecl *__cdecl _getdllprocaddr(intptr_t _Handle,char *_ProcedureName,intptr_t _Ordinal))(void);
    118 
    119 #ifdef _DECL_DLLMAIN
    120 #ifdef _WINDOWS_
    121   WINBOOL WINAPI DllMain(HANDLE _HDllHandle,DWORD _Reason,LPVOID _Reserved);
    122   WINBOOL WINAPI _CRT_INIT(HANDLE _HDllHandle,DWORD _Reason,LPVOID _Reserved);
    123   WINBOOL WINAPI _wCRT_INIT(HANDLE _HDllHandle,DWORD _Reason,LPVOID _Reserved);
    124   extern WINBOOL (WINAPI *const _pRawDllMain)(HANDLE,DWORD,LPVOID);
    125 #else
    126   int __stdcall DllMain(void *_HDllHandle,unsigned _Reason,void *_Reserved);
    127   int __stdcall _CRT_INIT(void *_HDllHandle,unsigned _Reason,void *_Reserved);
    128   int __stdcall _wCRT_INIT(void *_HDllHandle,unsigned _Reason,void *_Reserved);
    129   extern int (__stdcall *const _pRawDllMain)(void *,unsigned,void *);
    130 #endif
    131 #endif
    132 
    133 #ifndef	NO_OLDNAMES
    134 #define P_WAIT _P_WAIT
    135 #define P_NOWAIT _P_NOWAIT
    136 #define P_OVERLAY _P_OVERLAY
    137 #define OLD_P_OVERLAY _OLD_P_OVERLAY
    138 #define P_NOWAITO _P_NOWAITO
    139 #define P_DETACH _P_DETACH
    140 #define WAIT_CHILD _WAIT_CHILD
    141 #define WAIT_GRANDCHILD _WAIT_GRANDCHILD
    142 
    143   intptr_t __cdecl cwait(int *_TermStat,intptr_t _ProcHandle,int _Action) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
    144 #ifdef __GNUC__
    145   int __cdecl execl(const char *_Filename,const char *_ArgList,...) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
    146   int __cdecl execle(const char *_Filename,const char *_ArgList,...) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
    147   int __cdecl execlp(const char *_Filename,const char *_ArgList,...) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
    148   int __cdecl execlpe(const char *_Filename,const char *_ArgList,...) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
    149 #else
    150   intptr_t __cdecl execl(const char *_Filename,const char *_ArgList,...) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
    151   intptr_t __cdecl execle(const char *_Filename,const char *_ArgList,...) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
    152   intptr_t __cdecl execlp(const char *_Filename,const char *_ArgList,...) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
    153   intptr_t __cdecl execlpe(const char *_Filename,const char *_ArgList,...) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
    154 #endif
    155   intptr_t __cdecl spawnl(int,const char *_Filename,const char *_ArgList,...) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
    156   intptr_t __cdecl spawnle(int,const char *_Filename,const char *_ArgList,...) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
    157   intptr_t __cdecl spawnlp(int,const char *_Filename,const char *_ArgList,...) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
    158   intptr_t __cdecl spawnlpe(int,const char *_Filename,const char *_ArgList,...) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
    159   int __cdecl getpid(void) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
    160 #ifdef __GNUC__
    161   /* Those methods are predefined by gcc builtins to return int. So to prevent
    162      stupid warnings, define them in POSIX way.  This is save, because those
    163      methods do not return in success case, so that the return value is not
    164      really dependent to its scalar width.  */
    165   int __cdecl execv(const char *_Filename,char *const _ArgList[]) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
    166   int __cdecl execve(const char *_Filename,char *const _ArgList[],char *const _Env[]) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
    167   int __cdecl execvp(const char *_Filename,char *const _ArgList[]) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
    168   int __cdecl execvpe(const char *_Filename,char *const _ArgList[],char *const _Env[]) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
    169 #else
    170   intptr_t __cdecl execv(const char *_Filename,char *const _ArgList[]) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
    171   intptr_t __cdecl execve(const char *_Filename,char *const _ArgList[],char *const _Env[]) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
    172   intptr_t __cdecl execvp(const char *_Filename,char *const _ArgList[]) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
    173   intptr_t __cdecl execvpe(const char *_Filename,char *const _ArgList[],char *const _Env[]) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
    174 #endif
    175   intptr_t __cdecl spawnv(int,const char *_Filename,char *const _ArgList[]) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
    176   intptr_t __cdecl spawnve(int,const char *_Filename,char *const _ArgList[],char *const _Env[]) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
    177   intptr_t __cdecl spawnvp(int,const char *_Filename,char *const _ArgList[]) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
    178   intptr_t __cdecl spawnvpe(int,const char *_Filename,char *const _ArgList[],char *const _Env[]) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
    179 #endif
    180 
    181 #ifdef __cplusplus
    182 }
    183 #endif
    184 #endif
    185 #endif
    186