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