1 | /**************************************************************************** |
---|
2 | * * |
---|
3 | * GNAT COMPILER COMPONENTS * |
---|
4 | * * |
---|
5 | * G S O C K E T * |
---|
6 | * * |
---|
7 | * C Header File * |
---|
8 | * * |
---|
9 | * Copyright (C) 2004-2005, Free Software Foundation, Inc. * |
---|
10 | * * |
---|
11 | * GNAT is free software; you can redistribute it and/or modify it under * |
---|
12 | * terms of the GNU General Public License as published by the Free Soft- * |
---|
13 | * ware Foundation; either version 2, or (at your option) any later ver- * |
---|
14 | * sion. GNAT is distributed in the hope that it will be useful, but WITH- * |
---|
15 | * OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * |
---|
16 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * |
---|
17 | * for more details. You should have received a copy of the GNU General * |
---|
18 | * Public License distributed with GNAT; see file COPYING. If not, write * |
---|
19 | * to the Free Software Foundation, 51 Franklin Street, Fifth Floor, * |
---|
20 | * Boston, MA 02110-1301, USA. * |
---|
21 | * * |
---|
22 | * As a special exception, if you link this file with other files to * |
---|
23 | * produce an executable, this file does not by itself cause the resulting * |
---|
24 | * executable to be covered by the GNU General Public License. This except- * |
---|
25 | * ion does not however invalidate any other reasons why the executable * |
---|
26 | * file might be covered by the GNU Public License. * |
---|
27 | * * |
---|
28 | * GNAT was originally developed by the GNAT team at New York University. * |
---|
29 | * Extensive contributions were provided by Ada Core Technologies Inc. * |
---|
30 | * * |
---|
31 | ****************************************************************************/ |
---|
32 | |
---|
33 | #ifndef _XOPEN_SOURCE_EXTENDED |
---|
34 | #define _XOPEN_SOURCE_EXTENDED 1 |
---|
35 | /* For HP-UX */ |
---|
36 | #endif |
---|
37 | |
---|
38 | #ifndef BSD_COMP |
---|
39 | #define BSD_COMP 1 |
---|
40 | /* For Solaris */ |
---|
41 | #endif |
---|
42 | |
---|
43 | #ifndef _ALL_SOURCE |
---|
44 | #define _ALL_SOURCE 1 |
---|
45 | /* For AIX */ |
---|
46 | #endif |
---|
47 | |
---|
48 | #ifndef _OSF_SOURCE |
---|
49 | #define _OSF_SOURCE 1 |
---|
50 | /* For Tru64 */ |
---|
51 | #endif |
---|
52 | |
---|
53 | #include <limits.h> |
---|
54 | |
---|
55 | #if defined(__vxworks) |
---|
56 | #include <vxWorks.h> |
---|
57 | #include <ioLib.h> |
---|
58 | #include <hostLib.h> |
---|
59 | #include <resolvLib.h> |
---|
60 | #define SHUT_RD 0 |
---|
61 | #define SHUT_WR 1 |
---|
62 | #define SHUT_RDWR 2 |
---|
63 | |
---|
64 | #elif defined (WINNT) |
---|
65 | #define FD_SETSIZE 1024 |
---|
66 | #include <windows.h> |
---|
67 | |
---|
68 | #ifdef __MINGW32__ |
---|
69 | #include <winsock2.h> |
---|
70 | #include <ws2tcpip.h> |
---|
71 | |
---|
72 | #define EACCES WSAEACCES |
---|
73 | #define EADDRINUSE WSAEADDRINUSE |
---|
74 | #define EADDRNOTAVAIL WSAEADDRNOTAVAIL |
---|
75 | #define EAFNOSUPPORT WSAEAFNOSUPPORT |
---|
76 | #define EALREADY WSAEALREADY |
---|
77 | #define EBADF WSAEBADF |
---|
78 | #define ECONNABORTED WSAECONNABORTED |
---|
79 | #define ECONNREFUSED WSAECONNREFUSED |
---|
80 | #define ECONNRESET WSAECONNRESET |
---|
81 | #define EDESTADDRREQ WSAEDESTADDRREQ |
---|
82 | #define EFAULT WSAEFAULT |
---|
83 | #define EHOSTDOWN WSAEHOSTDOWN |
---|
84 | #define EHOSTUNREACH WSAEHOSTUNREACH |
---|
85 | #define EINPROGRESS WSAEINPROGRESS |
---|
86 | #define EINTR WSAEINTR |
---|
87 | #define EINVAL WSAEINVAL |
---|
88 | #define EIO WSAEDISCON |
---|
89 | #define EISCONN WSAEISCONN |
---|
90 | #define ELOOP WSAELOOP |
---|
91 | #define EMFILE WSAEMFILE |
---|
92 | #define EMSGSIZE WSAEMSGSIZE |
---|
93 | #define ENAMETOOLONG WSAENAMETOOLONG |
---|
94 | #define ENETDOWN WSAENETDOWN |
---|
95 | #define ENETRESET WSAENETRESET |
---|
96 | #define ENETUNREACH WSAENETUNREACH |
---|
97 | #define ENOBUFS WSAENOBUFS |
---|
98 | #define ENOPROTOOPT WSAENOPROTOOPT |
---|
99 | #define ENOTCONN WSAENOTCONN |
---|
100 | #define ENOTSOCK WSAENOTSOCK |
---|
101 | #define EOPNOTSUPP WSAEOPNOTSUPP |
---|
102 | #define EPFNOSUPPORT WSAEPFNOSUPPORT |
---|
103 | #define EPROTONOSUPPORT WSAEPROTONOSUPPORT |
---|
104 | #define ENOTSOCK WSAENOTSOCK |
---|
105 | #define EOPNOTSUPP WSAEOPNOTSUPP |
---|
106 | #define EPFNOSUPPORT WSAEPFNOSUPPORT |
---|
107 | #define EPROTONOSUPPORT WSAEPROTONOSUPPORT |
---|
108 | #define EPROTOTYPE WSAEPROTOTYPE |
---|
109 | #define ESHUTDOWN WSAESHUTDOWN |
---|
110 | #define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT |
---|
111 | #define ETIMEDOUT WSAETIMEDOUT |
---|
112 | #define ETOOMANYREFS WSAETOOMANYREFS |
---|
113 | #define EWOULDBLOCK WSAEWOULDBLOCK |
---|
114 | #define SHUT_RD SD_RECEIVE |
---|
115 | #define SHUT_WR SD_SEND |
---|
116 | #define SHUT_RDWR SD_BOTH |
---|
117 | |
---|
118 | #endif |
---|
119 | |
---|
120 | #elif defined(VMS) |
---|
121 | #define FD_SETSIZE 4096 |
---|
122 | #ifndef IN_RTS |
---|
123 | /* These DEC C headers are not available when building with GCC */ |
---|
124 | #include <in.h> |
---|
125 | #include <tcp.h> |
---|
126 | #include <ioctl.h> |
---|
127 | #include <netdb.h> |
---|
128 | #endif |
---|
129 | |
---|
130 | #endif |
---|
131 | |
---|
132 | #ifndef __MINGW32__ |
---|
133 | #include <errno.h> |
---|
134 | #endif |
---|
135 | |
---|
136 | #ifdef __vxworks |
---|
137 | #include <sys/times.h> |
---|
138 | #else |
---|
139 | #include <sys/time.h> |
---|
140 | #endif |
---|
141 | |
---|
142 | #if !(defined (VMS) || defined (__MINGW32__) || defined(__rtems__)) |
---|
143 | #include <sys/socket.h> |
---|
144 | #include <netinet/in.h> |
---|
145 | #include <netinet/tcp.h> |
---|
146 | #include <sys/ioctl.h> |
---|
147 | #include <netdb.h> |
---|
148 | #endif |
---|