xref: /php-src/ext/pcntl/php_pcntl.h (revision 962baf77)
1 /*
2    +----------------------------------------------------------------------+
3    | Copyright (c) The PHP Group                                          |
4    +----------------------------------------------------------------------+
5    | This source file is subject to version 3.01 of the PHP license,      |
6    | that is bundled with this package in the file LICENSE, and is        |
7    | available through the world-wide-web at the following url:           |
8    | https://www.php.net/license/3_01.txt                                 |
9    | If you did not receive a copy of the PHP license and are unable to   |
10    | obtain it through the world-wide-web, please send a note to          |
11    | license@php.net so we can mail you a copy immediately.               |
12    +----------------------------------------------------------------------+
13    | Author: Jason Greene <jason@inetgurus.net>                           |
14    +----------------------------------------------------------------------+
15  */
16 
17 #ifndef PHP_PCNTL_H
18 #define PHP_PCNTL_H
19 
20 #if defined(WCONTINUED) && defined(WIFCONTINUED)
21 #define HAVE_WCONTINUED 1
22 #endif
23 
24 extern zend_module_entry pcntl_module_entry;
25 #define phpext_pcntl_ptr &pcntl_module_entry
26 
27 #include "php_version.h"
28 #define PHP_PCNTL_VERSION PHP_VERSION
29 
30 PHP_MINIT_FUNCTION(pcntl);
31 PHP_MSHUTDOWN_FUNCTION(pcntl);
32 PHP_RINIT_FUNCTION(pcntl);
33 PHP_RSHUTDOWN_FUNCTION(pcntl);
34 PHP_MINFO_FUNCTION(pcntl);
35 
36 struct php_pcntl_pending_signal {
37 	struct php_pcntl_pending_signal *next;
38 	zend_long signo;
39 #ifdef HAVE_STRUCT_SIGINFO_T
40 	siginfo_t siginfo;
41 #endif
42 };
43 
44 ZEND_BEGIN_MODULE_GLOBALS(pcntl)
45 	HashTable php_signal_table;
46 	int processing_signal_queue;
47 	struct php_pcntl_pending_signal *head, *tail, *spares;
48 	int last_error;
49 	volatile char pending_signals;
50 	bool async_signals;
51 	unsigned num_signals;
52 ZEND_END_MODULE_GLOBALS(pcntl)
53 
54 #if defined(ZTS) && defined(COMPILE_DL_PCNTL)
55 ZEND_TSRMLS_CACHE_EXTERN()
56 #endif
57 
58 ZEND_EXTERN_MODULE_GLOBALS(pcntl)
59 #define PCNTL_G(v) ZEND_MODULE_GLOBALS_ACCESSOR(pcntl, v)
60 
61 #endif	/* PHP_PCNTL_H */
62