comparison nt/inc/sys/socket.h @ 412:697ef44129c6 r21-2-14

Import from CVS: tag r21-2-14
author cvs
date Mon, 13 Aug 2007 11:20:41 +0200
parents
children
comparison
equal deleted inserted replaced
411:12e008d41344 412:697ef44129c6
1 /* Workable version of <sys/socket.h> based on winsock.h */
2
3 #ifndef _SOCKET_H_
4 #define _SOCKET_H_
5
6 /* defeat the multiple include protection */
7 #ifdef _WINSOCKAPI_
8 #undef _WINSOCKAPI_
9 #endif
10
11 #if 0 /* What's wrong with winsock.h version ? - kkm */
12 /* avoid clashing with our version of FD_SET if already defined */
13 #ifdef FD_SET
14 #undef FD_SET
15 #undef FD_CLR
16 #undef FD_ISSET
17 #undef FD_ZERO
18 #endif
19
20 /* allow us to provide our own version of fd_set */
21 #define fd_set ws_fd_set
22 #endif /* 0 */
23
24 /* avoid duplicate definition of timeval */
25 #ifdef HAVE_TIMEVAL
26 #define timeval ws_timeval
27 #endif
28
29 #include <winsock.h>
30
31 #if 0 /* What's wrong with winsock.h version ? - kkm */
32 /* revert to our version of FD_SET */
33 #undef FD_SET
34 #undef FD_CLR
35 #undef FD_ISSET
36 #undef FD_ZERO
37 #undef fd_set
38 #include "nt.h"
39 #endif /* 0 */
40
41 #ifdef HAVE_TIMEVAL
42 #undef timeval
43 #endif
44
45 /* map winsock error codes to standard names */
46 #define EWOULDBLOCK WSAEWOULDBLOCK
47 #define EINPROGRESS WSAEINPROGRESS
48 #define EALREADY WSAEALREADY
49 #define ENOTSOCK WSAENOTSOCK
50 #define EDESTADDRREQ WSAEDESTADDRREQ
51 #define EMSGSIZE WSAEMSGSIZE
52 #define EPROTOTYPE WSAEPROTOTYPE
53 #define ENOPROTOOPT WSAENOPROTOOPT
54 #define EPROTONOSUPPORT WSAEPROTONOSUPPORT
55 #define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT
56 #define EOPNOTSUPP WSAEOPNOTSUPP
57 #define EPFNOSUPPORT WSAEPFNOSUPPORT
58 #define EAFNOSUPPORT WSAEAFNOSUPPORT
59 #define EADDRINUSE WSAEADDRINUSE
60 #define EADDRNOTAVAIL WSAEADDRNOTAVAIL
61 #define ENETDOWN WSAENETDOWN
62 #define ENETUNREACH WSAENETUNREACH
63 #define ENETRESET WSAENETRESET
64 #define ECONNABORTED WSAECONNABORTED
65 #define ECONNRESET WSAECONNRESET
66 #define ENOBUFS WSAENOBUFS
67 #define EISCONN WSAEISCONN
68 #define ENOTCONN WSAENOTCONN
69 #define ESHUTDOWN WSAESHUTDOWN
70 #define ETOOMANYREFS WSAETOOMANYREFS
71 #define ETIMEDOUT WSAETIMEDOUT
72 #define ECONNREFUSED WSAECONNREFUSED
73 #define ELOOP WSAELOOP
74 /* #define ENAMETOOLONG WSAENAMETOOLONG */
75 #define EHOSTDOWN WSAEHOSTDOWN
76 #define EHOSTUNREACH WSAEHOSTUNREACH
77 /* #define ENOTEMPTY WSAENOTEMPTY */
78 #define EPROCLIM WSAEPROCLIM
79 #define EUSERS WSAEUSERS
80 #define EDQUOT WSAEDQUOT
81 #define ESTALE WSAESTALE
82 #define EREMOTE WSAEREMOTE
83
84 #endif /* _SOCKET_H_ */
85
86 /* end of socket.h */