1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 #ifndef PHP_PCNTL_H
22 #define PHP_PCNTL_H
23
24 #if defined(WCONTINUED) && defined(WIFCONTINUED)
25 #define HAVE_WCONTINUED 1
26 #endif
27
28 extern zend_module_entry pcntl_module_entry;
29 #define phpext_pcntl_ptr &pcntl_module_entry
30
31 #include "php_version.h"
32 #define PHP_PCNTL_VERSION PHP_VERSION
33
34 PHP_MINIT_FUNCTION(pcntl);
35 PHP_MSHUTDOWN_FUNCTION(pcntl);
36 PHP_RINIT_FUNCTION(pcntl);
37 PHP_RSHUTDOWN_FUNCTION(pcntl);
38 PHP_MINFO_FUNCTION(pcntl);
39
40 PHP_FUNCTION(pcntl_alarm);
41 PHP_FUNCTION(pcntl_fork);
42 PHP_FUNCTION(pcntl_waitpid);
43 PHP_FUNCTION(pcntl_wait);
44 PHP_FUNCTION(pcntl_wifexited);
45 PHP_FUNCTION(pcntl_wifstopped);
46 PHP_FUNCTION(pcntl_wifsignaled);
47 #ifdef HAVE_WCONTINUED
48 PHP_FUNCTION(pcntl_wifcontinued);
49 #endif
50 PHP_FUNCTION(pcntl_wexitstatus);
51 PHP_FUNCTION(pcntl_wtermsig);
52 PHP_FUNCTION(pcntl_wstopsig);
53 PHP_FUNCTION(pcntl_signal);
54 PHP_FUNCTION(pcntl_signal_dispatch);
55 PHP_FUNCTION(pcntl_get_last_error);
56 PHP_FUNCTION(pcntl_strerror);
57 #ifdef HAVE_SIGPROCMASK
58 PHP_FUNCTION(pcntl_sigprocmask);
59 #endif
60 #if HAVE_SIGWAITINFO && HAVE_SIGTIMEDWAIT
61 PHP_FUNCTION(pcntl_sigwaitinfo);
62 PHP_FUNCTION(pcntl_sigtimedwait);
63 #endif
64 PHP_FUNCTION(pcntl_exec);
65 #ifdef HAVE_GETPRIORITY
66 PHP_FUNCTION(pcntl_getpriority);
67 #endif
68 #ifdef HAVE_SETPRIORITY
69 PHP_FUNCTION(pcntl_setpriority);
70 #endif
71
72 struct php_pcntl_pending_signal {
73 struct php_pcntl_pending_signal *next;
74 zend_long signo;
75 };
76
77 ZEND_BEGIN_MODULE_GLOBALS(pcntl)
78 HashTable php_signal_table;
79 int processing_signal_queue;
80 struct php_pcntl_pending_signal *head, *tail, *spares;
81 int last_error;
82 volatile char pending_signals;
83 ZEND_END_MODULE_GLOBALS(pcntl)
84
85 #ifdef ZTS
86 #define PCNTL_G(v) TSRMG(pcntl_globals_id, zend_pcntl_globals *, v)
87 #else
88 #define PCNTL_G(v) (pcntl_globals.v)
89 #endif
90
91 #define REGISTER_PCNTL_ERRNO_CONSTANT(name) REGISTER_LONG_CONSTANT("PCNTL_" #name, name, CONST_CS | CONST_PERSISTENT)
92
93 #endif
94
95
96
97
98
99
100
101
102