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