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