xref: /PHP-7.3/ext/pcntl/php_pcntl.h (revision 8d3f8ca1)
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 
19 #ifndef PHP_PCNTL_H
20 #define PHP_PCNTL_H
21 
22 #if defined(WCONTINUED) && defined(WIFCONTINUED)
23 #define HAVE_WCONTINUED 1
24 #endif
25 
26 extern zend_module_entry pcntl_module_entry;
27 #define phpext_pcntl_ptr &pcntl_module_entry
28 
29 #include "php_version.h"
30 #define PHP_PCNTL_VERSION PHP_VERSION
31 
32 PHP_MINIT_FUNCTION(pcntl);
33 PHP_MSHUTDOWN_FUNCTION(pcntl);
34 PHP_RINIT_FUNCTION(pcntl);
35 PHP_RSHUTDOWN_FUNCTION(pcntl);
36 PHP_MINFO_FUNCTION(pcntl);
37 
38 PHP_FUNCTION(pcntl_alarm);
39 PHP_FUNCTION(pcntl_fork);
40 PHP_FUNCTION(pcntl_waitpid);
41 PHP_FUNCTION(pcntl_wait);
42 PHP_FUNCTION(pcntl_wifexited);
43 PHP_FUNCTION(pcntl_wifstopped);
44 PHP_FUNCTION(pcntl_wifsignaled);
45 #ifdef HAVE_WCONTINUED
46 PHP_FUNCTION(pcntl_wifcontinued);
47 #endif
48 PHP_FUNCTION(pcntl_wexitstatus);
49 PHP_FUNCTION(pcntl_wtermsig);
50 PHP_FUNCTION(pcntl_wstopsig);
51 PHP_FUNCTION(pcntl_signal);
52 PHP_FUNCTION(pcntl_signal_get_handler);
53 PHP_FUNCTION(pcntl_signal_dispatch);
54 PHP_FUNCTION(pcntl_get_last_error);
55 PHP_FUNCTION(pcntl_strerror);
56 #ifdef HAVE_SIGPROCMASK
57 PHP_FUNCTION(pcntl_sigprocmask);
58 #endif
59 #ifdef HAVE_STRUCT_SIGINFO_T
60 # if HAVE_SIGWAITINFO && HAVE_SIGTIMEDWAIT
61 PHP_FUNCTION(pcntl_sigwaitinfo);
62 PHP_FUNCTION(pcntl_sigtimedwait);
63 # endif
64 #endif
65 PHP_FUNCTION(pcntl_exec);
66 #ifdef HAVE_GETPRIORITY
67 PHP_FUNCTION(pcntl_getpriority);
68 #endif
69 #ifdef HAVE_SETPRIORITY
70 PHP_FUNCTION(pcntl_setpriority);
71 #endif
72 PHP_FUNCTION(pcntl_async_signals);
73 
74 struct php_pcntl_pending_signal {
75 	struct php_pcntl_pending_signal *next;
76 	zend_long signo;
77 #ifdef HAVE_STRUCT_SIGINFO_T
78 	siginfo_t siginfo;
79 #endif
80 };
81 
82 ZEND_BEGIN_MODULE_GLOBALS(pcntl)
83 	HashTable php_signal_table;
84 	int processing_signal_queue;
85 	struct php_pcntl_pending_signal *head, *tail, *spares;
86 	int last_error;
87 	volatile char pending_signals;
88 	zend_bool async_signals;
89 ZEND_END_MODULE_GLOBALS(pcntl)
90 
91 #ifdef ZTS
92 #define PCNTL_G(v) TSRMG(pcntl_globals_id, zend_pcntl_globals *, v)
93 #else
94 #define PCNTL_G(v)	(pcntl_globals.v)
95 #endif
96 
97 #define REGISTER_PCNTL_ERRNO_CONSTANT(name) REGISTER_LONG_CONSTANT("PCNTL_" #name, name, CONST_CS | CONST_PERSISTENT)
98 
99 #endif	/* PHP_PCNTL_H */
100 
101 
102 /*
103  * Local variables:
104  * tab-width: 4
105  * c-basic-offset: 4
106  * indent-tabs-mode: t
107  * End:
108  */
109