1 /*
2   +----------------------------------------------------------------------+
3   | PHP Version 7                                                        |
4   +----------------------------------------------------------------------+
5   | Copyright (c) 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@php.net>                                 |
16   +----------------------------------------------------------------------+
17 */
18 
19 /* This file is to be included by sockets.c */
20 
21 #ifdef EPERM
22 	/* Operation not permitted */
23 	REGISTER_LONG_CONSTANT("SOCKET_EPERM", EPERM, CONST_CS | CONST_PERSISTENT);
24 #endif
25 #ifdef ENOENT
26 	/* No such file or directory */
27 	REGISTER_LONG_CONSTANT("SOCKET_ENOENT", ENOENT, CONST_CS | CONST_PERSISTENT);
28 #endif
29 #ifdef EINTR
30 	/* Interrupted system call */
31 	REGISTER_LONG_CONSTANT("SOCKET_EINTR", EINTR, CONST_CS | CONST_PERSISTENT);
32 #endif
33 #ifdef EIO
34 	/* I/O error */
35 	REGISTER_LONG_CONSTANT("SOCKET_EIO", EIO, CONST_CS | CONST_PERSISTENT);
36 #endif
37 #ifdef ENXIO
38 	/* No such device or address */
39 	REGISTER_LONG_CONSTANT("SOCKET_ENXIO", ENXIO, CONST_CS | CONST_PERSISTENT);
40 #endif
41 #ifdef E2BIG
42 	/* Arg list too long */
43 	REGISTER_LONG_CONSTANT("SOCKET_E2BIG", E2BIG, CONST_CS | CONST_PERSISTENT);
44 #endif
45 #ifdef EBADF
46 	/* Bad file number */
47 	REGISTER_LONG_CONSTANT("SOCKET_EBADF", EBADF, CONST_CS | CONST_PERSISTENT);
48 #endif
49 #ifdef EAGAIN
50 	/* Try again */
51 	REGISTER_LONG_CONSTANT("SOCKET_EAGAIN", EAGAIN, CONST_CS | CONST_PERSISTENT);
52 #endif
53 #ifdef ENOMEM
54 	/* Out of memory */
55 	REGISTER_LONG_CONSTANT("SOCKET_ENOMEM", ENOMEM, CONST_CS | CONST_PERSISTENT);
56 #endif
57 #ifdef EACCES
58 	/* Permission denied */
59 	REGISTER_LONG_CONSTANT("SOCKET_EACCES", EACCES, CONST_CS | CONST_PERSISTENT);
60 #endif
61 #ifdef EFAULT
62 	/* Bad address */
63 	REGISTER_LONG_CONSTANT("SOCKET_EFAULT", EFAULT, CONST_CS | CONST_PERSISTENT);
64 #endif
65 #ifdef ENOTBLK
66 	/* Block device required */
67 	REGISTER_LONG_CONSTANT("SOCKET_ENOTBLK", ENOTBLK, CONST_CS | CONST_PERSISTENT);
68 #endif
69 #ifdef EBUSY
70 	/* Device or resource busy */
71 	REGISTER_LONG_CONSTANT("SOCKET_EBUSY", EBUSY, CONST_CS | CONST_PERSISTENT);
72 #endif
73 #ifdef EEXIST
74 	/* File exists */
75 	REGISTER_LONG_CONSTANT("SOCKET_EEXIST", EEXIST, CONST_CS | CONST_PERSISTENT);
76 #endif
77 #ifdef EXDEV
78 	/* Cross-device link */
79 	REGISTER_LONG_CONSTANT("SOCKET_EXDEV", EXDEV, CONST_CS | CONST_PERSISTENT);
80 #endif
81 #ifdef ENODEV
82 	/* No such device */
83 	REGISTER_LONG_CONSTANT("SOCKET_ENODEV", ENODEV, CONST_CS | CONST_PERSISTENT);
84 #endif
85 #ifdef ENOTDIR
86 	/* Not a directory */
87 	REGISTER_LONG_CONSTANT("SOCKET_ENOTDIR", ENOTDIR, CONST_CS | CONST_PERSISTENT);
88 #endif
89 #ifdef EISDIR
90 	/* Is a directory */
91 	REGISTER_LONG_CONSTANT("SOCKET_EISDIR", EISDIR, CONST_CS | CONST_PERSISTENT);
92 #endif
93 #ifdef EINVAL
94 	/* Invalid argument */
95 	REGISTER_LONG_CONSTANT("SOCKET_EINVAL", EINVAL, CONST_CS | CONST_PERSISTENT);
96 #endif
97 #ifdef ENFILE
98 	/* File table overflow */
99 	REGISTER_LONG_CONSTANT("SOCKET_ENFILE", ENFILE, CONST_CS | CONST_PERSISTENT);
100 #endif
101 #ifdef EMFILE
102 	/* Too many open files */
103 	REGISTER_LONG_CONSTANT("SOCKET_EMFILE", EMFILE, CONST_CS | CONST_PERSISTENT);
104 #endif
105 #ifdef ENOTTY
106 	/* Not a typewriter */
107 	REGISTER_LONG_CONSTANT("SOCKET_ENOTTY", ENOTTY, CONST_CS | CONST_PERSISTENT);
108 #endif
109 #ifdef ENOSPC
110 	/* No space left on device */
111 	REGISTER_LONG_CONSTANT("SOCKET_ENOSPC", ENOSPC, CONST_CS | CONST_PERSISTENT);
112 #endif
113 #ifdef ESPIPE
114 	/* Illegal seek */
115 	REGISTER_LONG_CONSTANT("SOCKET_ESPIPE", ESPIPE, CONST_CS | CONST_PERSISTENT);
116 #endif
117 #ifdef EROFS
118 	/* Read-only file system */
119 	REGISTER_LONG_CONSTANT("SOCKET_EROFS", EROFS, CONST_CS | CONST_PERSISTENT);
120 #endif
121 #ifdef EMLINK
122 	/* Too many links */
123 	REGISTER_LONG_CONSTANT("SOCKET_EMLINK", EMLINK, CONST_CS | CONST_PERSISTENT);
124 #endif
125 #ifdef EPIPE
126 	/* Broken pipe */
127 	REGISTER_LONG_CONSTANT("SOCKET_EPIPE", EPIPE, CONST_CS | CONST_PERSISTENT);
128 #endif
129 #ifdef ENAMETOOLONG
130 	/* File name too long */
131 	REGISTER_LONG_CONSTANT("SOCKET_ENAMETOOLONG", ENAMETOOLONG, CONST_CS | CONST_PERSISTENT);
132 #endif
133 #ifdef ENOLCK
134 	/* No record locks available */
135 	REGISTER_LONG_CONSTANT("SOCKET_ENOLCK", ENOLCK, CONST_CS | CONST_PERSISTENT);
136 #endif
137 #ifdef ENOSYS
138 	/* Function not implemented */
139 	REGISTER_LONG_CONSTANT("SOCKET_ENOSYS", ENOSYS, CONST_CS | CONST_PERSISTENT);
140 #endif
141 #ifdef ENOTEMPTY
142 	/* Directory not empty */
143 	REGISTER_LONG_CONSTANT("SOCKET_ENOTEMPTY", ENOTEMPTY, CONST_CS | CONST_PERSISTENT);
144 #endif
145 #ifdef ELOOP
146 	/* Too many symbolic links encountered */
147 	REGISTER_LONG_CONSTANT("SOCKET_ELOOP", ELOOP, CONST_CS | CONST_PERSISTENT);
148 #endif
149 #ifdef EWOULDBLOCK
150 	/* Operation would block */
151 	REGISTER_LONG_CONSTANT("SOCKET_EWOULDBLOCK", EWOULDBLOCK, CONST_CS | CONST_PERSISTENT);
152 #endif
153 #ifdef ENOMSG
154 	/* No message of desired type */
155 	REGISTER_LONG_CONSTANT("SOCKET_ENOMSG", ENOMSG, CONST_CS | CONST_PERSISTENT);
156 #endif
157 #ifdef EIDRM
158 	/* Identifier removed */
159 	REGISTER_LONG_CONSTANT("SOCKET_EIDRM", EIDRM, CONST_CS | CONST_PERSISTENT);
160 #endif
161 #ifdef ECHRNG
162 	/* Channel number out of range */
163 	REGISTER_LONG_CONSTANT("SOCKET_ECHRNG", ECHRNG, CONST_CS | CONST_PERSISTENT);
164 #endif
165 #ifdef EL2NSYNC
166 	/* Level 2 not synchronized */
167 	REGISTER_LONG_CONSTANT("SOCKET_EL2NSYNC", EL2NSYNC, CONST_CS | CONST_PERSISTENT);
168 #endif
169 #ifdef EL3HLT
170 	/* Level 3 halted */
171 	REGISTER_LONG_CONSTANT("SOCKET_EL3HLT", EL3HLT, CONST_CS | CONST_PERSISTENT);
172 #endif
173 #ifdef EL3RST
174 	/* Level 3 reset */
175 	REGISTER_LONG_CONSTANT("SOCKET_EL3RST", EL3RST, CONST_CS | CONST_PERSISTENT);
176 #endif
177 #ifdef ELNRNG
178 	/* Link number out of range */
179 	REGISTER_LONG_CONSTANT("SOCKET_ELNRNG", ELNRNG, CONST_CS | CONST_PERSISTENT);
180 #endif
181 #ifdef EUNATCH
182 	/* Protocol driver not attached */
183 	REGISTER_LONG_CONSTANT("SOCKET_EUNATCH", EUNATCH, CONST_CS | CONST_PERSISTENT);
184 #endif
185 #ifdef ENOCSI
186 	/* No CSI structure available */
187 	REGISTER_LONG_CONSTANT("SOCKET_ENOCSI", ENOCSI, CONST_CS | CONST_PERSISTENT);
188 #endif
189 #ifdef EL2HLT
190 	/* Level 2 halted */
191 	REGISTER_LONG_CONSTANT("SOCKET_EL2HLT", EL2HLT, CONST_CS | CONST_PERSISTENT);
192 #endif
193 #ifdef EBADE
194 	/* Invalid exchange */
195 	REGISTER_LONG_CONSTANT("SOCKET_EBADE", EBADE, CONST_CS | CONST_PERSISTENT);
196 #endif
197 #ifdef EBADR
198 	/* Invalid request descriptor */
199 	REGISTER_LONG_CONSTANT("SOCKET_EBADR", EBADR, CONST_CS | CONST_PERSISTENT);
200 #endif
201 #ifdef EXFULL
202 	/* Exchange full */
203 	REGISTER_LONG_CONSTANT("SOCKET_EXFULL", EXFULL, CONST_CS | CONST_PERSISTENT);
204 #endif
205 #ifdef ENOANO
206 	/* No anode */
207 	REGISTER_LONG_CONSTANT("SOCKET_ENOANO", ENOANO, CONST_CS | CONST_PERSISTENT);
208 #endif
209 #ifdef EBADRQC
210 	/* Invalid request code */
211 	REGISTER_LONG_CONSTANT("SOCKET_EBADRQC", EBADRQC, CONST_CS | CONST_PERSISTENT);
212 #endif
213 #ifdef EBADSLT
214 	/* Invalid slot */
215 	REGISTER_LONG_CONSTANT("SOCKET_EBADSLT", EBADSLT, CONST_CS | CONST_PERSISTENT);
216 #endif
217 #ifdef ENOSTR
218 	/* Device not a stream */
219 	REGISTER_LONG_CONSTANT("SOCKET_ENOSTR", ENOSTR, CONST_CS | CONST_PERSISTENT);
220 #endif
221 #ifdef ENODATA
222 	/* No data available */
223 	REGISTER_LONG_CONSTANT("SOCKET_ENODATA", ENODATA, CONST_CS | CONST_PERSISTENT);
224 #endif
225 #ifdef ETIME
226 	/* Timer expired */
227 	REGISTER_LONG_CONSTANT("SOCKET_ETIME", ETIME, CONST_CS | CONST_PERSISTENT);
228 #endif
229 #ifdef ENOSR
230 	/* Out of streams resources */
231 	REGISTER_LONG_CONSTANT("SOCKET_ENOSR", ENOSR, CONST_CS | CONST_PERSISTENT);
232 #endif
233 #ifdef ENONET
234 	/* Machine is not on the network */
235 	REGISTER_LONG_CONSTANT("SOCKET_ENONET", ENONET, CONST_CS | CONST_PERSISTENT);
236 #endif
237 #ifdef EREMOTE
238 	/* Object is remote */
239 	REGISTER_LONG_CONSTANT("SOCKET_EREMOTE", EREMOTE, CONST_CS | CONST_PERSISTENT);
240 #endif
241 #ifdef ENOLINK
242 	/* Link has been severed */
243 	REGISTER_LONG_CONSTANT("SOCKET_ENOLINK", ENOLINK, CONST_CS | CONST_PERSISTENT);
244 #endif
245 #ifdef EADV
246 	/* Advertise error */
247 	REGISTER_LONG_CONSTANT("SOCKET_EADV", EADV, CONST_CS | CONST_PERSISTENT);
248 #endif
249 #ifdef ESRMNT
250 	/* Srmount error */
251 	REGISTER_LONG_CONSTANT("SOCKET_ESRMNT", ESRMNT, CONST_CS | CONST_PERSISTENT);
252 #endif
253 #ifdef ECOMM
254 	/* Communication error on send */
255 	REGISTER_LONG_CONSTANT("SOCKET_ECOMM", ECOMM, CONST_CS | CONST_PERSISTENT);
256 #endif
257 #ifdef EPROTO
258 	/* Protocol error */
259 	REGISTER_LONG_CONSTANT("SOCKET_EPROTO", EPROTO, CONST_CS | CONST_PERSISTENT);
260 #endif
261 #ifdef EMULTIHOP
262 	/* Multihop attempted */
263 	REGISTER_LONG_CONSTANT("SOCKET_EMULTIHOP", EMULTIHOP, CONST_CS | CONST_PERSISTENT);
264 #endif
265 #ifdef EBADMSG
266 	/* Not a data message */
267 	REGISTER_LONG_CONSTANT("SOCKET_EBADMSG", EBADMSG, CONST_CS | CONST_PERSISTENT);
268 #endif
269 #ifdef ENOTUNIQ
270 	/* Name not unique on network */
271 	REGISTER_LONG_CONSTANT("SOCKET_ENOTUNIQ", ENOTUNIQ, CONST_CS | CONST_PERSISTENT);
272 #endif
273 #ifdef EBADFD
274 	/* File descriptor in bad state */
275 	REGISTER_LONG_CONSTANT("SOCKET_EBADFD", EBADFD, CONST_CS | CONST_PERSISTENT);
276 #endif
277 #ifdef EREMCHG
278 	/* Remote address changed */
279 	REGISTER_LONG_CONSTANT("SOCKET_EREMCHG", EREMCHG, CONST_CS | CONST_PERSISTENT);
280 #endif
281 #ifdef ERESTART
282 	/* Interrupted system call should be restarted */
283 	REGISTER_LONG_CONSTANT("SOCKET_ERESTART", ERESTART, CONST_CS | CONST_PERSISTENT);
284 #endif
285 #ifdef ESTRPIPE
286 	/* Streams pipe error */
287 	REGISTER_LONG_CONSTANT("SOCKET_ESTRPIPE", ESTRPIPE, CONST_CS | CONST_PERSISTENT);
288 #endif
289 #ifdef EUSERS
290 	/* Too many users */
291 	REGISTER_LONG_CONSTANT("SOCKET_EUSERS", EUSERS, CONST_CS | CONST_PERSISTENT);
292 #endif
293 #ifdef ENOTSOCK
294 	/* Socket operation on non-socket */
295 	REGISTER_LONG_CONSTANT("SOCKET_ENOTSOCK", ENOTSOCK, CONST_CS | CONST_PERSISTENT);
296 #endif
297 #ifdef EDESTADDRREQ
298 	/* Destination address required */
299 	REGISTER_LONG_CONSTANT("SOCKET_EDESTADDRREQ", EDESTADDRREQ, CONST_CS | CONST_PERSISTENT);
300 #endif
301 #ifdef EMSGSIZE
302 	/* Message too long */
303 	REGISTER_LONG_CONSTANT("SOCKET_EMSGSIZE", EMSGSIZE, CONST_CS | CONST_PERSISTENT);
304 #endif
305 #ifdef EPROTOTYPE
306 	/* Protocol wrong type for socket */
307 	REGISTER_LONG_CONSTANT("SOCKET_EPROTOTYPE", EPROTOTYPE, CONST_CS | CONST_PERSISTENT);
308 #endif
309 #ifdef ENOPROTOOPT
310 	/* Protocol not available */
311 	REGISTER_LONG_CONSTANT("SOCKET_ENOPROTOOPT", ENOPROTOOPT, CONST_CS | CONST_PERSISTENT);
312 #endif
313 #ifdef EPROTONOSUPPORT
314 	/* Protocol not supported */
315 	REGISTER_LONG_CONSTANT("SOCKET_EPROTONOSUPPORT", EPROTONOSUPPORT, CONST_CS | CONST_PERSISTENT);
316 #endif
317 #ifdef ESOCKTNOSUPPORT
318 	/* Socket type not supported */
319 	REGISTER_LONG_CONSTANT("SOCKET_ESOCKTNOSUPPORT", ESOCKTNOSUPPORT, CONST_CS | CONST_PERSISTENT);
320 #endif
321 #ifdef EOPNOTSUPP
322 	/* Operation not supported on transport endpoint */
323 	REGISTER_LONG_CONSTANT("SOCKET_EOPNOTSUPP", EOPNOTSUPP, CONST_CS | CONST_PERSISTENT);
324 #endif
325 #ifdef EPFNOSUPPORT
326 	/* Protocol family not supported */
327 	REGISTER_LONG_CONSTANT("SOCKET_EPFNOSUPPORT", EPFNOSUPPORT, CONST_CS | CONST_PERSISTENT);
328 #endif
329 #ifdef EAFNOSUPPORT
330 	/* Address family not supported by protocol */
331 	REGISTER_LONG_CONSTANT("SOCKET_EAFNOSUPPORT", EAFNOSUPPORT, CONST_CS | CONST_PERSISTENT);
332 #endif
333 #ifdef EADDRINUSE
334 	/* Address already in use */
335 	REGISTER_LONG_CONSTANT("SOCKET_EADDRINUSE", EADDRINUSE, CONST_CS | CONST_PERSISTENT);
336 #endif
337 #ifdef EADDRNOTAVAIL
338 	/* Cannot assign requested address */
339 	REGISTER_LONG_CONSTANT("SOCKET_EADDRNOTAVAIL", EADDRNOTAVAIL, CONST_CS | CONST_PERSISTENT);
340 #endif
341 #ifdef ENETDOWN
342 	/* Network is down */
343 	REGISTER_LONG_CONSTANT("SOCKET_ENETDOWN", ENETDOWN, CONST_CS | CONST_PERSISTENT);
344 #endif
345 #ifdef ENETUNREACH
346 	/* Network is unreachable */
347 	REGISTER_LONG_CONSTANT("SOCKET_ENETUNREACH", ENETUNREACH, CONST_CS | CONST_PERSISTENT);
348 #endif
349 #ifdef ENETRESET
350 	/* Network dropped connection because of reset */
351 	REGISTER_LONG_CONSTANT("SOCKET_ENETRESET", ENETRESET, CONST_CS | CONST_PERSISTENT);
352 #endif
353 #ifdef ECONNABORTED
354 	/* Software caused connection abort */
355 	REGISTER_LONG_CONSTANT("SOCKET_ECONNABORTED", ECONNABORTED, CONST_CS | CONST_PERSISTENT);
356 #endif
357 #ifdef ECONNRESET
358 	/* Connection reset by peer */
359 	REGISTER_LONG_CONSTANT("SOCKET_ECONNRESET", ECONNRESET, CONST_CS | CONST_PERSISTENT);
360 #endif
361 #ifdef ENOBUFS
362 	/* No buffer space available */
363 	REGISTER_LONG_CONSTANT("SOCKET_ENOBUFS", ENOBUFS, CONST_CS | CONST_PERSISTENT);
364 #endif
365 #ifdef EISCONN
366 	/* Transport endpoint is already connected */
367 	REGISTER_LONG_CONSTANT("SOCKET_EISCONN", EISCONN, CONST_CS | CONST_PERSISTENT);
368 #endif
369 #ifdef ENOTCONN
370 	/* Transport endpoint is not connected */
371 	REGISTER_LONG_CONSTANT("SOCKET_ENOTCONN", ENOTCONN, CONST_CS | CONST_PERSISTENT);
372 #endif
373 #ifdef ESHUTDOWN
374 	/* Cannot send after transport endpoint shutdown */
375 	REGISTER_LONG_CONSTANT("SOCKET_ESHUTDOWN", ESHUTDOWN, CONST_CS | CONST_PERSISTENT);
376 #endif
377 #ifdef ETOOMANYREFS
378 	/* Too many references: cannot splice */
379 	REGISTER_LONG_CONSTANT("SOCKET_ETOOMANYREFS", ETOOMANYREFS, CONST_CS | CONST_PERSISTENT);
380 #endif
381 #ifdef ETIMEDOUT
382 	/* Connection timed out */
383 	REGISTER_LONG_CONSTANT("SOCKET_ETIMEDOUT", ETIMEDOUT, CONST_CS | CONST_PERSISTENT);
384 #endif
385 #ifdef ECONNREFUSED
386 	/* Connection refused */
387 	REGISTER_LONG_CONSTANT("SOCKET_ECONNREFUSED", ECONNREFUSED, CONST_CS | CONST_PERSISTENT);
388 #endif
389 #ifdef EHOSTDOWN
390 	/* Host is down */
391 	REGISTER_LONG_CONSTANT("SOCKET_EHOSTDOWN", EHOSTDOWN, CONST_CS | CONST_PERSISTENT);
392 #endif
393 #ifdef EHOSTUNREACH
394 	/* No route to host */
395 	REGISTER_LONG_CONSTANT("SOCKET_EHOSTUNREACH", EHOSTUNREACH, CONST_CS | CONST_PERSISTENT);
396 #endif
397 #ifdef EALREADY
398 	/* Operation already in progress */
399 	REGISTER_LONG_CONSTANT("SOCKET_EALREADY", EALREADY, CONST_CS | CONST_PERSISTENT);
400 #endif
401 #ifdef EINPROGRESS
402 	/* Operation now in progress */
403 	REGISTER_LONG_CONSTANT("SOCKET_EINPROGRESS", EINPROGRESS, CONST_CS | CONST_PERSISTENT);
404 #endif
405 #ifdef EISNAM
406 	/* Is a named type file */
407 	REGISTER_LONG_CONSTANT("SOCKET_EISNAM", EISNAM, CONST_CS | CONST_PERSISTENT);
408 #endif
409 #ifdef EREMOTEIO
410 	/* Remote I/O error */
411 	REGISTER_LONG_CONSTANT("SOCKET_EREMOTEIO", EREMOTEIO, CONST_CS | CONST_PERSISTENT);
412 #endif
413 #ifdef EDQUOT
414 	/* Quota exceeded */
415 	REGISTER_LONG_CONSTANT("SOCKET_EDQUOT", EDQUOT, CONST_CS | CONST_PERSISTENT);
416 #endif
417 #ifdef ENOMEDIUM
418 	/* No medium found */
419 	REGISTER_LONG_CONSTANT("SOCKET_ENOMEDIUM", ENOMEDIUM, CONST_CS | CONST_PERSISTENT);
420 #endif
421 #ifdef EMEDIUMTYPE
422 	/* Wrong medium type */
423 	REGISTER_LONG_CONSTANT("SOCKET_EMEDIUMTYPE", EMEDIUMTYPE, CONST_CS | CONST_PERSISTENT);
424 #endif
425