1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 #ifndef PHP_POSIX_H
23 #define PHP_POSIX_H
24
25 #ifdef HAVE_CONFIG_H
26 #include "config.h"
27 #endif
28
29 #if HAVE_POSIX
30 #ifndef DLEXPORT
31 #define DLEXPORT
32 #endif
33
34 extern zend_module_entry posix_module_entry;
35 #define posix_module_ptr &posix_module_entry
36
37 #include "php_version.h"
38 #define PHP_POSIX_VERSION PHP_VERSION
39
40
41 PHP_FUNCTION(posix_kill);
42
43
44 PHP_FUNCTION(posix_getpid);
45 PHP_FUNCTION(posix_getppid);
46
47
48 PHP_FUNCTION(posix_getuid);
49 PHP_FUNCTION(posix_getgid);
50 PHP_FUNCTION(posix_geteuid);
51 PHP_FUNCTION(posix_getegid);
52 PHP_FUNCTION(posix_setuid);
53 PHP_FUNCTION(posix_setgid);
54 #ifdef HAVE_SETEUID
55 PHP_FUNCTION(posix_seteuid);
56 #endif
57 #ifdef HAVE_SETEGID
58 PHP_FUNCTION(posix_setegid);
59 #endif
60 #ifdef HAVE_GETGROUPS
61 PHP_FUNCTION(posix_getgroups);
62 #endif
63 #ifdef HAVE_GETLOGIN
64 PHP_FUNCTION(posix_getlogin);
65 #endif
66
67
68 PHP_FUNCTION(posix_getpgrp);
69 #ifdef HAVE_SETSID
70 PHP_FUNCTION(posix_setsid);
71 #endif
72 PHP_FUNCTION(posix_setpgid);
73
74 #ifdef HAVE_GETPGID
75 PHP_FUNCTION(posix_getpgid);
76 #endif
77 #ifdef HAVE_GETSID
78 PHP_FUNCTION(posix_getsid);
79 #endif
80
81
82 PHP_FUNCTION(posix_uname);
83 PHP_FUNCTION(posix_times);
84
85
86 #ifdef HAVE_CTERMID
87 PHP_FUNCTION(posix_ctermid);
88 #endif
89 PHP_FUNCTION(posix_ttyname);
90 PHP_FUNCTION(posix_isatty);
91
92
93 PHP_FUNCTION(posix_getcwd);
94
95
96 #ifdef HAVE_MKFIFO
97 PHP_FUNCTION(posix_mkfifo);
98 #endif
99 #ifdef HAVE_MKNOD
100 PHP_FUNCTION(posix_mknod);
101 #endif
102
103
104 PHP_FUNCTION(posix_access);
105
106
107 PHP_FUNCTION(posix_getgrnam);
108 PHP_FUNCTION(posix_getgrgid);
109 PHP_FUNCTION(posix_getpwnam);
110 PHP_FUNCTION(posix_getpwuid);
111
112 #ifdef HAVE_GETRLIMIT
113 PHP_FUNCTION(posix_getrlimit);
114 #endif
115
116 #ifdef HAVE_SETRLIMIT
117 PHP_FUNCTION(posix_setrlimit);
118 #endif
119
120 #ifdef HAVE_INITGROUPS
121 PHP_FUNCTION(posix_initgroups);
122 #endif
123
124 PHP_FUNCTION(posix_get_last_error);
125 PHP_FUNCTION(posix_strerror);
126
127 ZEND_BEGIN_MODULE_GLOBALS(posix)
128 int last_error;
129 ZEND_END_MODULE_GLOBALS(posix)
130
131 #ifdef ZTS
132 # define POSIX_G(v) TSRMG(posix_globals_id, zend_posix_globals *, v)
133 #else
134 # define POSIX_G(v) (posix_globals.v)
135 #endif
136
137 #else
138
139 #define posix_module_ptr NULL
140
141 #endif
142
143 #define phpext_posix_ptr posix_module_ptr
144
145 #endif