php_pcntl.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /*
  2. +----------------------------------------------------------------------+
  3. | PHP Version 7 |
  4. +----------------------------------------------------------------------+
  5. | Copyright (c) 1997-2018 The PHP Group |
  6. +----------------------------------------------------------------------+
  7. | This source file is subject to version 3.01 of the PHP license, |
  8. | that is bundled with this package in the file LICENSE, and is |
  9. | available through the world-wide-web at the following url: |
  10. | http://www.php.net/license/3_01.txt |
  11. | If you did not receive a copy of the PHP license and are unable to |
  12. | obtain it through the world-wide-web, please send a note to |
  13. | license@php.net so we can mail you a copy immediately. |
  14. +----------------------------------------------------------------------+
  15. | Author: Jason Greene <jason@inetgurus.net> |
  16. +----------------------------------------------------------------------+
  17. */
  18. #ifndef PHP_PCNTL_H
  19. #define PHP_PCNTL_H
  20. #if defined(WCONTINUED) && defined(WIFCONTINUED)
  21. #define HAVE_WCONTINUED 1
  22. #endif
  23. extern zend_module_entry pcntl_module_entry;
  24. #define phpext_pcntl_ptr &pcntl_module_entry
  25. #include "php_version.h"
  26. #define PHP_PCNTL_VERSION PHP_VERSION
  27. PHP_MINIT_FUNCTION(pcntl);
  28. PHP_MSHUTDOWN_FUNCTION(pcntl);
  29. PHP_RINIT_FUNCTION(pcntl);
  30. PHP_RSHUTDOWN_FUNCTION(pcntl);
  31. PHP_MINFO_FUNCTION(pcntl);
  32. PHP_FUNCTION(pcntl_alarm);
  33. PHP_FUNCTION(pcntl_fork);
  34. PHP_FUNCTION(pcntl_waitpid);
  35. PHP_FUNCTION(pcntl_wait);
  36. PHP_FUNCTION(pcntl_wifexited);
  37. PHP_FUNCTION(pcntl_wifstopped);
  38. PHP_FUNCTION(pcntl_wifsignaled);
  39. #ifdef HAVE_WCONTINUED
  40. PHP_FUNCTION(pcntl_wifcontinued);
  41. #endif
  42. PHP_FUNCTION(pcntl_wexitstatus);
  43. PHP_FUNCTION(pcntl_wtermsig);
  44. PHP_FUNCTION(pcntl_wstopsig);
  45. PHP_FUNCTION(pcntl_signal);
  46. PHP_FUNCTION(pcntl_signal_get_handler);
  47. PHP_FUNCTION(pcntl_signal_dispatch);
  48. PHP_FUNCTION(pcntl_get_last_error);
  49. PHP_FUNCTION(pcntl_strerror);
  50. #ifdef HAVE_SIGPROCMASK
  51. PHP_FUNCTION(pcntl_sigprocmask);
  52. #endif
  53. #ifdef HAVE_STRUCT_SIGINFO_T
  54. # if HAVE_SIGWAITINFO && HAVE_SIGTIMEDWAIT
  55. PHP_FUNCTION(pcntl_sigwaitinfo);
  56. PHP_FUNCTION(pcntl_sigtimedwait);
  57. # endif
  58. #endif
  59. PHP_FUNCTION(pcntl_exec);
  60. #ifdef HAVE_GETPRIORITY
  61. PHP_FUNCTION(pcntl_getpriority);
  62. #endif
  63. #ifdef HAVE_SETPRIORITY
  64. PHP_FUNCTION(pcntl_setpriority);
  65. #endif
  66. PHP_FUNCTION(pcntl_async_signals);
  67. struct php_pcntl_pending_signal {
  68. struct php_pcntl_pending_signal *next;
  69. zend_long signo;
  70. #ifdef HAVE_STRUCT_SIGINFO_T
  71. siginfo_t siginfo;
  72. #endif
  73. };
  74. ZEND_BEGIN_MODULE_GLOBALS(pcntl)
  75. HashTable php_signal_table;
  76. int processing_signal_queue;
  77. struct php_pcntl_pending_signal *head, *tail, *spares;
  78. int last_error;
  79. volatile char pending_signals;
  80. zend_bool async_signals;
  81. ZEND_END_MODULE_GLOBALS(pcntl)
  82. #ifdef ZTS
  83. #define PCNTL_G(v) TSRMG(pcntl_globals_id, zend_pcntl_globals *, v)
  84. #else
  85. #define PCNTL_G(v) (pcntl_globals.v)
  86. #endif
  87. #define REGISTER_PCNTL_ERRNO_CONSTANT(name) REGISTER_LONG_CONSTANT("PCNTL_" #name, name, CONST_CS | CONST_PERSISTENT)
  88. #endif /* PHP_PCNTL_H */
  89. /*
  90. * Local variables:
  91. * tab-width: 4
  92. * c-basic-offset: 4
  93. * indent-tabs-mode: t
  94. * End:
  95. */