1 /* This is a generated file, edit the .stub.php file instead.
2 * Stub hash: e7f501e4ca2c30f6bf52ea5912037c1e59743949 */
3
4 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_posix_kill, 0, 2, _IS_BOOL, 0)
5 ZEND_ARG_TYPE_INFO(0, process_id, IS_LONG, 0)
6 ZEND_ARG_TYPE_INFO(0, signal, IS_LONG, 0)
7 ZEND_END_ARG_INFO()
8
9 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_posix_getpid, 0, 0, IS_LONG, 0)
10 ZEND_END_ARG_INFO()
11
12 #define arginfo_posix_getppid arginfo_posix_getpid
13
14 #define arginfo_posix_getuid arginfo_posix_getpid
15
16 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_posix_setuid, 0, 1, _IS_BOOL, 0)
17 ZEND_ARG_TYPE_INFO(0, user_id, IS_LONG, 0)
18 ZEND_END_ARG_INFO()
19
20 #define arginfo_posix_geteuid arginfo_posix_getpid
21
22 #if defined(HAVE_SETEUID)
23 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_posix_seteuid, 0, 1, _IS_BOOL, 0)
24 ZEND_ARG_TYPE_INFO(0, user_id, IS_LONG, 0)
25 ZEND_END_ARG_INFO()
26 #endif
27
28 #define arginfo_posix_getgid arginfo_posix_getpid
29
30 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_posix_setgid, 0, 1, _IS_BOOL, 0)
31 ZEND_ARG_TYPE_INFO(0, group_id, IS_LONG, 0)
32 ZEND_END_ARG_INFO()
33
34 #define arginfo_posix_getegid arginfo_posix_getpid
35
36 #if defined(HAVE_SETEGID)
37 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_posix_setegid, 0, 1, _IS_BOOL, 0)
38 ZEND_ARG_TYPE_INFO(0, group_id, IS_LONG, 0)
39 ZEND_END_ARG_INFO()
40 #endif
41
42 #if defined(HAVE_GETGROUPS)
43 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_posix_getgroups, 0, 0, MAY_BE_ARRAY|MAY_BE_FALSE)
44 ZEND_END_ARG_INFO()
45 #endif
46
47 #if defined(HAVE_GETLOGIN)
48 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_posix_getlogin, 0, 0, MAY_BE_STRING|MAY_BE_FALSE)
49 ZEND_END_ARG_INFO()
50 #endif
51
52 #define arginfo_posix_getpgrp arginfo_posix_getpid
53
54 #if defined(HAVE_SETSID)
55 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_posix_setsid, 0, 0, IS_LONG, 0)
56 ZEND_END_ARG_INFO()
57 #endif
58
59 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_posix_setpgid, 0, 2, _IS_BOOL, 0)
60 ZEND_ARG_TYPE_INFO(0, process_id, IS_LONG, 0)
61 ZEND_ARG_TYPE_INFO(0, process_group_id, IS_LONG, 0)
62 ZEND_END_ARG_INFO()
63
64 #if defined(HAVE_GETPGID)
65 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_posix_getpgid, 0, 1, MAY_BE_LONG|MAY_BE_FALSE)
66 ZEND_ARG_TYPE_INFO(0, process_id, IS_LONG, 0)
67 ZEND_END_ARG_INFO()
68 #endif
69
70 #if defined(HAVE_GETSID)
71 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_posix_getsid, 0, 1, MAY_BE_LONG|MAY_BE_FALSE)
72 ZEND_ARG_TYPE_INFO(0, process_id, IS_LONG, 0)
73 ZEND_END_ARG_INFO()
74 #endif
75
76 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_posix_uname, 0, 0, MAY_BE_ARRAY|MAY_BE_FALSE)
77 ZEND_END_ARG_INFO()
78
79 #define arginfo_posix_times arginfo_posix_uname
80
81 #if defined(HAVE_CTERMID)
82 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_posix_ctermid, 0, 0, MAY_BE_STRING|MAY_BE_FALSE)
83 ZEND_END_ARG_INFO()
84 #endif
85
86 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_posix_ttyname, 0, 1, MAY_BE_STRING|MAY_BE_FALSE)
87 ZEND_ARG_INFO(0, file_descriptor)
88 ZEND_END_ARG_INFO()
89
90 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_posix_isatty, 0, 1, _IS_BOOL, 0)
91 ZEND_ARG_INFO(0, file_descriptor)
92 ZEND_END_ARG_INFO()
93
94 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_posix_getcwd, 0, 0, MAY_BE_STRING|MAY_BE_FALSE)
95 ZEND_END_ARG_INFO()
96
97 #if defined(HAVE_MKFIFO)
98 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_posix_mkfifo, 0, 2, _IS_BOOL, 0)
99 ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
100 ZEND_ARG_TYPE_INFO(0, permissions, IS_LONG, 0)
101 ZEND_END_ARG_INFO()
102 #endif
103
104 #if defined(HAVE_MKNOD)
105 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_posix_mknod, 0, 2, _IS_BOOL, 0)
106 ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
107 ZEND_ARG_TYPE_INFO(0, flags, IS_LONG, 0)
108 ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, major, IS_LONG, 0, "0")
109 ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, minor, IS_LONG, 0, "0")
110 ZEND_END_ARG_INFO()
111 #endif
112
113 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_posix_access, 0, 1, _IS_BOOL, 0)
114 ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
115 ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0")
116 ZEND_END_ARG_INFO()
117
118 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_posix_getgrnam, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE)
119 ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0)
120 ZEND_END_ARG_INFO()
121
122 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_posix_getgrgid, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE)
123 ZEND_ARG_TYPE_INFO(0, group_id, IS_LONG, 0)
124 ZEND_END_ARG_INFO()
125
126 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_posix_getpwnam, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE)
127 ZEND_ARG_TYPE_INFO(0, username, IS_STRING, 0)
128 ZEND_END_ARG_INFO()
129
130 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_posix_getpwuid, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE)
131 ZEND_ARG_TYPE_INFO(0, user_id, IS_LONG, 0)
132 ZEND_END_ARG_INFO()
133
134 #if defined(HAVE_GETRLIMIT)
135 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_posix_getrlimit, 0, 0, MAY_BE_ARRAY|MAY_BE_FALSE)
136 ZEND_END_ARG_INFO()
137 #endif
138
139 #if defined(HAVE_SETRLIMIT)
140 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_posix_setrlimit, 0, 3, _IS_BOOL, 0)
141 ZEND_ARG_TYPE_INFO(0, resource, IS_LONG, 0)
142 ZEND_ARG_TYPE_INFO(0, soft_limit, IS_LONG, 0)
143 ZEND_ARG_TYPE_INFO(0, hard_limit, IS_LONG, 0)
144 ZEND_END_ARG_INFO()
145 #endif
146
147 #define arginfo_posix_get_last_error arginfo_posix_getpid
148
149 #define arginfo_posix_errno arginfo_posix_getpid
150
151 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_posix_strerror, 0, 1, IS_STRING, 0)
152 ZEND_ARG_TYPE_INFO(0, error_code, IS_LONG, 0)
153 ZEND_END_ARG_INFO()
154
155 #if defined(HAVE_INITGROUPS)
156 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_posix_initgroups, 0, 2, _IS_BOOL, 0)
157 ZEND_ARG_TYPE_INFO(0, username, IS_STRING, 0)
158 ZEND_ARG_TYPE_INFO(0, group_id, IS_LONG, 0)
159 ZEND_END_ARG_INFO()
160 #endif
161
162
163 ZEND_FUNCTION(posix_kill);
164 ZEND_FUNCTION(posix_getpid);
165 ZEND_FUNCTION(posix_getppid);
166 ZEND_FUNCTION(posix_getuid);
167 ZEND_FUNCTION(posix_setuid);
168 ZEND_FUNCTION(posix_geteuid);
169 #if defined(HAVE_SETEUID)
170 ZEND_FUNCTION(posix_seteuid);
171 #endif
172 ZEND_FUNCTION(posix_getgid);
173 ZEND_FUNCTION(posix_setgid);
174 ZEND_FUNCTION(posix_getegid);
175 #if defined(HAVE_SETEGID)
176 ZEND_FUNCTION(posix_setegid);
177 #endif
178 #if defined(HAVE_GETGROUPS)
179 ZEND_FUNCTION(posix_getgroups);
180 #endif
181 #if defined(HAVE_GETLOGIN)
182 ZEND_FUNCTION(posix_getlogin);
183 #endif
184 ZEND_FUNCTION(posix_getpgrp);
185 #if defined(HAVE_SETSID)
186 ZEND_FUNCTION(posix_setsid);
187 #endif
188 ZEND_FUNCTION(posix_setpgid);
189 #if defined(HAVE_GETPGID)
190 ZEND_FUNCTION(posix_getpgid);
191 #endif
192 #if defined(HAVE_GETSID)
193 ZEND_FUNCTION(posix_getsid);
194 #endif
195 ZEND_FUNCTION(posix_uname);
196 ZEND_FUNCTION(posix_times);
197 #if defined(HAVE_CTERMID)
198 ZEND_FUNCTION(posix_ctermid);
199 #endif
200 ZEND_FUNCTION(posix_ttyname);
201 ZEND_FUNCTION(posix_isatty);
202 ZEND_FUNCTION(posix_getcwd);
203 #if defined(HAVE_MKFIFO)
204 ZEND_FUNCTION(posix_mkfifo);
205 #endif
206 #if defined(HAVE_MKNOD)
207 ZEND_FUNCTION(posix_mknod);
208 #endif
209 ZEND_FUNCTION(posix_access);
210 ZEND_FUNCTION(posix_getgrnam);
211 ZEND_FUNCTION(posix_getgrgid);
212 ZEND_FUNCTION(posix_getpwnam);
213 ZEND_FUNCTION(posix_getpwuid);
214 #if defined(HAVE_GETRLIMIT)
215 ZEND_FUNCTION(posix_getrlimit);
216 #endif
217 #if defined(HAVE_SETRLIMIT)
218 ZEND_FUNCTION(posix_setrlimit);
219 #endif
220 ZEND_FUNCTION(posix_get_last_error);
221 ZEND_FUNCTION(posix_strerror);
222 #if defined(HAVE_INITGROUPS)
223 ZEND_FUNCTION(posix_initgroups);
224 #endif
225
226
227 static const zend_function_entry ext_functions[] = {
228 ZEND_FE(posix_kill, arginfo_posix_kill)
229 ZEND_FE(posix_getpid, arginfo_posix_getpid)
230 ZEND_FE(posix_getppid, arginfo_posix_getppid)
231 ZEND_FE(posix_getuid, arginfo_posix_getuid)
232 ZEND_FE(posix_setuid, arginfo_posix_setuid)
233 ZEND_FE(posix_geteuid, arginfo_posix_geteuid)
234 #if defined(HAVE_SETEUID)
235 ZEND_FE(posix_seteuid, arginfo_posix_seteuid)
236 #endif
237 ZEND_FE(posix_getgid, arginfo_posix_getgid)
238 ZEND_FE(posix_setgid, arginfo_posix_setgid)
239 ZEND_FE(posix_getegid, arginfo_posix_getegid)
240 #if defined(HAVE_SETEGID)
241 ZEND_FE(posix_setegid, arginfo_posix_setegid)
242 #endif
243 #if defined(HAVE_GETGROUPS)
244 ZEND_FE(posix_getgroups, arginfo_posix_getgroups)
245 #endif
246 #if defined(HAVE_GETLOGIN)
247 ZEND_FE(posix_getlogin, arginfo_posix_getlogin)
248 #endif
249 ZEND_FE(posix_getpgrp, arginfo_posix_getpgrp)
250 #if defined(HAVE_SETSID)
251 ZEND_FE(posix_setsid, arginfo_posix_setsid)
252 #endif
253 ZEND_FE(posix_setpgid, arginfo_posix_setpgid)
254 #if defined(HAVE_GETPGID)
255 ZEND_FE(posix_getpgid, arginfo_posix_getpgid)
256 #endif
257 #if defined(HAVE_GETSID)
258 ZEND_FE(posix_getsid, arginfo_posix_getsid)
259 #endif
260 ZEND_FE(posix_uname, arginfo_posix_uname)
261 ZEND_FE(posix_times, arginfo_posix_times)
262 #if defined(HAVE_CTERMID)
263 ZEND_FE(posix_ctermid, arginfo_posix_ctermid)
264 #endif
265 ZEND_FE(posix_ttyname, arginfo_posix_ttyname)
266 ZEND_FE(posix_isatty, arginfo_posix_isatty)
267 ZEND_FE(posix_getcwd, arginfo_posix_getcwd)
268 #if defined(HAVE_MKFIFO)
269 ZEND_FE(posix_mkfifo, arginfo_posix_mkfifo)
270 #endif
271 #if defined(HAVE_MKNOD)
272 ZEND_FE(posix_mknod, arginfo_posix_mknod)
273 #endif
274 ZEND_FE(posix_access, arginfo_posix_access)
275 ZEND_FE(posix_getgrnam, arginfo_posix_getgrnam)
276 ZEND_FE(posix_getgrgid, arginfo_posix_getgrgid)
277 ZEND_FE(posix_getpwnam, arginfo_posix_getpwnam)
278 ZEND_FE(posix_getpwuid, arginfo_posix_getpwuid)
279 #if defined(HAVE_GETRLIMIT)
280 ZEND_FE(posix_getrlimit, arginfo_posix_getrlimit)
281 #endif
282 #if defined(HAVE_SETRLIMIT)
283 ZEND_FE(posix_setrlimit, arginfo_posix_setrlimit)
284 #endif
285 ZEND_FE(posix_get_last_error, arginfo_posix_get_last_error)
286 ZEND_FALIAS(posix_errno, posix_get_last_error, arginfo_posix_errno)
287 ZEND_FE(posix_strerror, arginfo_posix_strerror)
288 #if defined(HAVE_INITGROUPS)
289 ZEND_FE(posix_initgroups, arginfo_posix_initgroups)
290 #endif
291 ZEND_FE_END
292 };
293
register_posix_symbols(int module_number)294 static void register_posix_symbols(int module_number)
295 {
296 REGISTER_LONG_CONSTANT("POSIX_F_OK", F_OK, CONST_PERSISTENT);
297 REGISTER_LONG_CONSTANT("POSIX_X_OK", X_OK, CONST_PERSISTENT);
298 REGISTER_LONG_CONSTANT("POSIX_W_OK", W_OK, CONST_PERSISTENT);
299 REGISTER_LONG_CONSTANT("POSIX_R_OK", R_OK, CONST_PERSISTENT);
300 #if defined(S_IFREG)
301 REGISTER_LONG_CONSTANT("POSIX_S_IFREG", S_IFREG, CONST_PERSISTENT);
302 #endif
303 #if defined(S_IFCHR)
304 REGISTER_LONG_CONSTANT("POSIX_S_IFCHR", S_IFCHR, CONST_PERSISTENT);
305 #endif
306 #if defined(S_IFBLK)
307 REGISTER_LONG_CONSTANT("POSIX_S_IFBLK", S_IFBLK, CONST_PERSISTENT);
308 #endif
309 #if defined(S_IFIFO)
310 REGISTER_LONG_CONSTANT("POSIX_S_IFIFO", S_IFIFO, CONST_PERSISTENT);
311 #endif
312 #if defined(S_IFSOCK)
313 REGISTER_LONG_CONSTANT("POSIX_S_IFSOCK", S_IFSOCK, CONST_PERSISTENT);
314 #endif
315 #if defined(RLIMIT_AS)
316 REGISTER_LONG_CONSTANT("POSIX_RLIMIT_AS", RLIMIT_AS, CONST_PERSISTENT);
317 #endif
318 #if defined(RLIMIT_CORE)
319 REGISTER_LONG_CONSTANT("POSIX_RLIMIT_CORE", RLIMIT_CORE, CONST_PERSISTENT);
320 #endif
321 #if defined(RLIMIT_CPU)
322 REGISTER_LONG_CONSTANT("POSIX_RLIMIT_CPU", RLIMIT_CPU, CONST_PERSISTENT);
323 #endif
324 #if defined(RLIMIT_DATA)
325 REGISTER_LONG_CONSTANT("POSIX_RLIMIT_DATA", RLIMIT_DATA, CONST_PERSISTENT);
326 #endif
327 #if defined(RLIMIT_FSIZE)
328 REGISTER_LONG_CONSTANT("POSIX_RLIMIT_FSIZE", RLIMIT_FSIZE, CONST_PERSISTENT);
329 #endif
330 #if defined(RLIMIT_LOCKS)
331 REGISTER_LONG_CONSTANT("POSIX_RLIMIT_LOCKS", RLIMIT_LOCKS, CONST_PERSISTENT);
332 #endif
333 #if defined(RLIMIT_MEMLOCK)
334 REGISTER_LONG_CONSTANT("POSIX_RLIMIT_MEMLOCK", RLIMIT_MEMLOCK, CONST_PERSISTENT);
335 #endif
336 #if defined(RLIMIT_MSGQUEUE)
337 REGISTER_LONG_CONSTANT("POSIX_RLIMIT_MSGQUEUE", RLIMIT_MSGQUEUE, CONST_PERSISTENT);
338 #endif
339 #if defined(RLIMIT_NICE)
340 REGISTER_LONG_CONSTANT("POSIX_RLIMIT_NICE", RLIMIT_NICE, CONST_PERSISTENT);
341 #endif
342 #if defined(RLIMIT_NOFILE)
343 REGISTER_LONG_CONSTANT("POSIX_RLIMIT_NOFILE", RLIMIT_NOFILE, CONST_PERSISTENT);
344 #endif
345 #if defined(RLIMIT_NPROC)
346 REGISTER_LONG_CONSTANT("POSIX_RLIMIT_NPROC", RLIMIT_NPROC, CONST_PERSISTENT);
347 #endif
348 #if defined(RLIMIT_RSS)
349 REGISTER_LONG_CONSTANT("POSIX_RLIMIT_RSS", RLIMIT_RSS, CONST_PERSISTENT);
350 #endif
351 #if defined(RLIMIT_RTPRIO)
352 REGISTER_LONG_CONSTANT("POSIX_RLIMIT_RTPRIO", RLIMIT_RTPRIO, CONST_PERSISTENT);
353 #endif
354 #if defined(RLIMIT_RTTIME)
355 REGISTER_LONG_CONSTANT("POSIX_RLIMIT_RTTIME", RLIMIT_RTTIME, CONST_PERSISTENT);
356 #endif
357 #if defined(RLIMIT_SIGPENDING)
358 REGISTER_LONG_CONSTANT("POSIX_RLIMIT_SIGPENDING", RLIMIT_SIGPENDING, CONST_PERSISTENT);
359 #endif
360 #if defined(RLIMIT_STACK)
361 REGISTER_LONG_CONSTANT("POSIX_RLIMIT_STACK", RLIMIT_STACK, CONST_PERSISTENT);
362 #endif
363 #if defined(RLIMIT_KQUEUES)
364 REGISTER_LONG_CONSTANT("POSIX_RLIMIT_KQUEUES", RLIMIT_KQUEUES, CONST_PERSISTENT);
365 #endif
366 #if defined(RLIMIT_NPTS)
367 REGISTER_LONG_CONSTANT("POSIX_RLIMIT_NPTS", RLIMIT_NPTS, CONST_PERSISTENT);
368 #endif
369 #if defined(HAVE_SETRLIMIT)
370 REGISTER_LONG_CONSTANT("POSIX_RLIMIT_INFINITY", RLIM_INFINITY, CONST_PERSISTENT);
371 #endif
372 }
373