From 3dd76200fc82c60951b48eff3a377e3be2d3ac00 Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Fri, 6 Feb 1998 00:07:37 +0000 Subject: [PATCH] added errno macros --- src/include/os/WIN32/osiSock.h | 30 ++++++--- src/include/os/alpha/osiSock.h | 15 +++++ src/include/os/cygwin32/osiSock.h | 15 +++++ src/include/os/hp700/osiSock.h | 15 +++++ src/include/os/sgi/osiSock.h | 15 +++++ src/include/os/solaris/osiSock.h | 15 +++++ src/include/os/sun4/osiSock.h | 15 +++++ src/include/os/vms/osiSock.h | 91 +++++++++++++++++++--------- src/include/os/vxWorks/osiSock.h | 15 +++++ src/libCom/osi/os/VMS/osiSock.h | 91 +++++++++++++++++++--------- src/libCom/osi/os/WIN32/osdSock.h | 30 ++++++--- src/libCom/osi/os/alpha/osdSock.h | 15 +++++ src/libCom/osi/os/cygwin32/osdSock.h | 15 +++++ src/libCom/osi/os/hpux/osdSock.h | 15 +++++ src/libCom/osi/os/sgi/osdSock.h | 15 +++++ src/libCom/osi/os/solaris/osdSock.h | 15 +++++ src/libCom/osi/os/sun4/osdSock.h | 15 +++++ src/libCom/osi/os/vxWorks/osdSock.h | 15 +++++ 18 files changed, 378 insertions(+), 74 deletions(-) diff --git a/src/include/os/WIN32/osiSock.h b/src/include/os/WIN32/osiSock.h index 3c7de4a90..8c2af4f75 100644 --- a/src/include/os/WIN32/osiSock.h +++ b/src/include/os/WIN32/osiSock.h @@ -15,21 +15,31 @@ extern "C" { #endif #define SOCKERRNO WSAGetLastError() +/* + * I dont think that this works, but winsock does + * not appear to provide equivalent functionality + * here + */ +#define SOCKERRSTR (strerror(SOCKERRNO)) #define socket_close(S) closesocket(S) #define socket_ioctl(A,B,C) ioctlsocket(A,B,(unsigned long *) C) #define MAXHOSTNAMELEN 75 #define IPPORT_USERRESERVED 5000U -#define EWOULDBLOCK WSAEWOULDBLOCK -#define ENOBUFS WSAENOBUFS -#define ECONNRESET WSAECONNRESET -#define ETIMEDOUT WSAETIMEDOUT -#define EADDRINUSE WSAEADDRINUSE -#define ECONNREFUSED WSAECONNREFUSED -#define ECONNABORTED WSAECONNABORTED -#define EINPROGRESS WSAEINPROGRESS -#define EISCONN WSAEISCONN -#define EALREADY WSAEALREADY + +#define SOCK_EWOULDBLOCK WSAEWOULDBLOCK +#define SOCK_ENOBUFS WSAENOBUFS +#define SOCK_ECONNRESET WSAECONNRESET +#define SOCK_ETIMEDOUT WSAETIMEDOUT +#define SOCK_EADDRINUSE WSAEADDRINUSE +#define SOCK_ECONNREFUSED WSAECONNREFUSED +#define SOCK_ECONNABORTED WSAECONNABORTED +#define SOCK_EINPROGRESS WSAEINPROGRESS +#define SOCK_EISCONN WSAEISCONN +#define SOCK_EALREADY WSAEALREADY +#define SOCK_EINVAL WSAEINVAL +#define SOCK_EINTR WSAEINTR +#define SOCK_EPIPE EPIPE /* * Under WIN32, FD_SETSIZE is the max. number of sockets, diff --git a/src/include/os/alpha/osiSock.h b/src/include/os/alpha/osiSock.h index 9bd38beb7..d954dee79 100644 --- a/src/include/os/alpha/osiSock.h +++ b/src/include/os/alpha/osiSock.h @@ -40,10 +40,25 @@ int sethostname(char *name, int namelen); typedef int SOCKET; #define INVALID_SOCKET (-1) #define SOCKERRNO errno +#define SOCKERRSTR (strerror(errno)) #define socket_close(S) close(S) #define socket_ioctl(A,B,C) ioctl(A,B,C) #define FD_IN_FDSET(FD) ((FD)=0) +#define SOCK_EWOULDBLOCK EWOULDBLOCK +#define SOCK_ENOBUFS ENOBUFS +#define SOCK_ECONNRESET ECONNRESET +#define SOCK_ETIMEDOUT ETIMEDOUT +#define SOCK_EADDRINUSE EADDRINUSE +#define SOCK_ECONNREFUSED ECONNREFUSED +#define SOCK_ECONNABORTED ECONNABORTED +#define SOCK_EINPROGRESS EINPROGRESS +#define SOCK_EISCONN EISCONN +#define SOCK_EALREADY EALREADY +#define SOCK_EINVAL EINVAL +#define SOCK_EINTR EINTR +#define SOCK_EPIPE EPIPE + #endif /*osiSockH*/ diff --git a/src/include/os/cygwin32/osiSock.h b/src/include/os/cygwin32/osiSock.h index 8927f9a42..1de9336f3 100644 --- a/src/include/os/cygwin32/osiSock.h +++ b/src/include/os/cygwin32/osiSock.h @@ -36,6 +36,7 @@ int sethostname(char *name, int namelen); typedef int SOCKET; #define INVALID_SOCKET (-1) #define SOCKERRNO errno +#define SOCKERRSTR (strerror(errno)) #define socket_close(S) close(S) #define socket_ioctl(A,B,C) ioctl(A,B,C) @@ -63,5 +64,19 @@ typedef int SOCKET; #define SO_SNDBUF 0x1001 /* send buffer size */ #define SO_RCVBUF 0x1002 /* receive buffer size */ +#define SOCK_EWOULDBLOCK EWOULDBLOCK +#define SOCK_ENOBUFS ENOBUFS +#define SOCK_ECONNRESET ECONNRESET +#define SOCK_ETIMEDOUT ETIMEDOUT +#define SOCK_EADDRINUSE EADDRINUSE +#define SOCK_ECONNREFUSED ECONNREFUSED +#define SOCK_ECONNABORTED ECONNABORTED +#define SOCK_EINPROGRESS EINPROGRESS +#define SOCK_EISCONN EISCONN +#define SOCK_EALREADY EALREADY +#define SOCK_EINVAL EINVAL +#define SOCK_EINTR EINTR +#define SOCK_EPIPE EPIPE + #endif /*osiSockH*/ diff --git a/src/include/os/hp700/osiSock.h b/src/include/os/hp700/osiSock.h index a71a5dde9..b7e2718ab 100644 --- a/src/include/os/hp700/osiSock.h +++ b/src/include/os/hp700/osiSock.h @@ -44,10 +44,25 @@ int sethostname(char *name, int namelen); typedef int SOCKET; #define INVALID_SOCKET (-1) #define SOCKERRNO errno +#define SOCKERRSTR (strerror(errno)) #define socket_close(S) close(S) #define socket_ioctl(A,B,C) ioctl(A,B,C) #define FD_IN_FDSET(FD) ((FD)=0) +#define SOCK_EWOULDBLOCK EWOULDBLOCK +#define SOCK_ENOBUFS ENOBUFS +#define SOCK_ECONNRESET ECONNRESET +#define SOCK_ETIMEDOUT ETIMEDOUT +#define SOCK_EADDRINUSE EADDRINUSE +#define SOCK_ECONNREFUSED ECONNREFUSED +#define SOCK_ECONNABORTED ECONNABORTED +#define SOCK_EINPROGRESS EINPROGRESS +#define SOCK_EISCONN EISCONN +#define SOCK_EALREADY EALREADY +#define SOCK_EINVAL EINVAL +#define SOCK_EINTR EINTR +#define SOCK_EPIPE EPIPE + #endif /*osiSockH*/ diff --git a/src/include/os/sgi/osiSock.h b/src/include/os/sgi/osiSock.h index 217c5abdd..0ca4378cd 100644 --- a/src/include/os/sgi/osiSock.h +++ b/src/include/os/sgi/osiSock.h @@ -39,10 +39,25 @@ extern "C" { typedef int SOCKET; #define INVALID_SOCKET (-1) #define SOCKERRNO errno +#define SOCKERRSTR (strerror(errno)) #define socket_close(S) close(S) #define socket_ioctl(A,B,C) ioctl(A,B,C) #define FD_IN_FDSET(FD) ((FD)=0) +#define SOCK_EWOULDBLOCK EWOULDBLOCK +#define SOCK_ENOBUFS ENOBUFS +#define SOCK_ECONNRESET ECONNRESET +#define SOCK_ETIMEDOUT ETIMEDOUT +#define SOCK_EADDRINUSE EADDRINUSE +#define SOCK_ECONNREFUSED ECONNREFUSED +#define SOCK_ECONNABORTED ECONNABORTED +#define SOCK_EINPROGRESS EINPROGRESS +#define SOCK_EISCONN EISCONN +#define SOCK_EALREADY EALREADY +#define SOCK_EINVAL EINVAL +#define SOCK_EINTR EINTR +#define SOCK_EPIPE EPIPE + #endif /*osiSockH*/ diff --git a/src/include/os/solaris/osiSock.h b/src/include/os/solaris/osiSock.h index c6fe10f71..37a2278e8 100644 --- a/src/include/os/solaris/osiSock.h +++ b/src/include/os/solaris/osiSock.h @@ -50,10 +50,25 @@ int sethostname(char *name, int namelen); typedef int SOCKET; #define INVALID_SOCKET (-1) #define SOCKERRNO errno +#define SOCKERRSTR (strerror(errno)) #define socket_close(S) close(S) #define socket_ioctl(A,B,C) ioctl(A,B,C) #define FD_IN_FDSET(FD) ((FD)=0) +#define SOCK_EWOULDBLOCK EWOULDBLOCK +#define SOCK_ENOBUFS ENOBUFS +#define SOCK_ECONNRESET ECONNRESET +#define SOCK_ETIMEDOUT ETIMEDOUT +#define SOCK_EADDRINUSE EADDRINUSE +#define SOCK_ECONNREFUSED ECONNREFUSED +#define SOCK_ECONNABORTED ECONNABORTED +#define SOCK_EINPROGRESS EINPROGRESS +#define SOCK_EISCONN EISCONN +#define SOCK_EALREADY EALREADY +#define SOCK_EINVAL EINVAL +#define SOCK_EINTR EINTR +#define SOCK_EPIPE EPIPE + #endif /*osiSockH*/ diff --git a/src/include/os/sun4/osiSock.h b/src/include/os/sun4/osiSock.h index c29412c8a..b2be3247a 100644 --- a/src/include/os/sun4/osiSock.h +++ b/src/include/os/sun4/osiSock.h @@ -89,6 +89,7 @@ int gethostname (char *name, int namelen); typedef int SOCKET; #define INVALID_SOCKET (-1) #define SOCKERRNO errno +#define SOCKERRSTR (strerror(errno)) #define socket_close(S) close(S) #define socket_ioctl(A,B,C) ioctl(A,B,C) @@ -99,5 +100,19 @@ typedef int SOCKET; #define FD_IN_FDSET(FD) ((FD)=0) +#define SOCK_EWOULDBLOCK EWOULDBLOCK +#define SOCK_ENOBUFS ENOBUFS +#define SOCK_ECONNRESET ECONNRESET +#define SOCK_ETIMEDOUT ETIMEDOUT +#define SOCK_EADDRINUSE EADDRINUSE +#define SOCK_ECONNREFUSED ECONNREFUSED +#define SOCK_ECONNABORTED ECONNABORTED +#define SOCK_EINPROGRESS EINPROGRESS +#define SOCK_EISCONN EISCONN +#define SOCK_EALREADY EALREADY +#define SOCK_EINVAL EINVAL +#define SOCK_EINTR EINTR +#define SOCK_EPIPE EPIPE + #endif /*osiSockH*/ diff --git a/src/include/os/vms/osiSock.h b/src/include/os/vms/osiSock.h index 9e2cebe30..8230473a4 100644 --- a/src/include/os/vms/osiSock.h +++ b/src/include/os/vms/osiSock.h @@ -13,33 +13,42 @@ extern "C" { #if defined(MULTINET) && defined(__cplusplus) struct iovec; #endif + #include #include #include #if defined(UCX) /* GeG 09-DEC-1992 */ # include -# include -# include +# include +# include # include -#else -# include -# include -# include -# if defined(MULTINET) && defined(__cplusplus) +#elif defined(MULTINET) +# if defined(__DECCXX) +# define __DECC 1 +# define __DECC_VER 999999999 +# include +# include +# undef __DECC +# undef __DECC_VER +# else +# include +# include +# endif +# if defined(__cplusplus) struct ifaddr; struct mbuf; # endif -# include -# include -# include +# include +# include +# include +# include # include #endif /* * MULTINET defines none of these (if not using C++) */ -#ifndef __cplusplus -#if 0 +#if defined(MULTINET) && defined(MULTINET_NO_PROTOTYPES) int gettimeofday (struct timeval *tp, struct timezone *tzp); int gethostname (char *name, int namelen); int accept (int socket, struct sockaddr *addr, int *addrlen); @@ -60,18 +69,20 @@ int getsockopt (int socket, int level, int optname, int recvfrom (int socket, char *buf, int len, int flags, struct sockaddr *from, int *fromlen); int getsockname (int socket, struct sockaddr *name, int *namelen); - -#endif /* if 0 */ - int listen (int socket, int backlog); int shutdown (int socket, int how); int socket (int domain, int type, int protocol); -#endif /* __cplusplus */ +#endif /* defined(MULTINET) && defined(MULTINET_NO_PROTOTYPES) */ void bzero (char *b, int length); -char * inet_ntoa (struct in_addr in); -unsigned long inet_addr (char *); +#ifdef MULTINET +# include + int gettimeofday (struct timeval *tp, ...); +#else + char * inet_ntoa (struct in_addr in); + unsigned long inet_addr (const char *); +#endif #if 0 struct hostent { @@ -103,21 +114,47 @@ typedef int SOCKET; # define socket_ioctl(A,B,C) ioctl(A,B,C) #endif - -#ifdef WINTCP /* Wallangong */ - extern int uerrno; +#if defined(WINTCP) /* Wallangong */ + extern int uerrno; # define SOCKERRNO uerrno +#elif defined(MULTINET) +# define SOCKERRNO socket_errno #else -# ifdef UCX -# define SOCKERRNO errno -# else -# define SOCKERRNO socket_errno -# endif +# define SOCKERRNO errno /* UCX and others? */ #endif +/* + * !! this is no doubt incorrect !! + * (error messages will be confusing until + * this is fixed) + */ +#define SOCKERRSTR (strerror(SOCKERRNO)) + #define MAXHOSTNAMELEN 75 -#define FD_IN_FDSET(FD) ((FD)=0) +#define SOCK_EWOULDBLOCK EWOULDBLOCK +#define SOCK_ENOBUFS ENOBUFS +#define SOCK_ECONNRESET ECONNRESET +#define SOCK_ETIMEDOUT ETIMEDOUT +#define SOCK_EADDRINUSE EADDRINUSE +#define SOCK_ECONNREFUSED ECONNREFUSED +#define SOCK_ECONNABORTED ECONNABORTED +#define SOCK_EINPROGRESS EINPROGRESS +#define SOCK_EISCONN EISCONN +#define SOCK_EALREADY EALREADY +#define SOCK_EINVAL EINVAL +#define SOCK_EINTR EINTR +#define SOCK_EPIPE EPIPE + +/* + * Under MULTINET FD_SETSIZE does not apply + * (can only guess about the others) + */ +#ifdef MULTINET +# define FD_IN_FDSET(FD) (1) +#else +# define FD_IN_FDSET(FD) ((FD)=0) +#endif #endif /*osiSockH*/ diff --git a/src/include/os/vxWorks/osiSock.h b/src/include/os/vxWorks/osiSock.h index cde99b4d2..4f099c910 100644 --- a/src/include/os/vxWorks/osiSock.h +++ b/src/include/os/vxWorks/osiSock.h @@ -28,11 +28,26 @@ extern "C" { typedef int SOCKET; #define INVALID_SOCKET (-1) #define SOCKERRNO errno +#define SOCKERRSTR (strerror(SOCKERRNO)) #define socket_close(S) close(S) #define socket_ioctl(A,B,C) ioctl(A,B,(int)C) #define FD_IN_FDSET(FD) ((FD)=0) +#define SOCK_EWOULDBLOCK EWOULDBLOCK +#define SOCK_ENOBUFS ENOBUFS +#define SOCK_ECONNRESET ECONNRESET +#define SOCK_ETIMEDOUT ETIMEDOUT +#define SOCK_EADDRINUSE EADDRINUSE +#define SOCK_ECONNREFUSED ECONNREFUSED +#define SOCK_ECONNABORTED ECONNABORTED +#define SOCK_EINPROGRESS EINPROGRESS +#define SOCK_EISCONN EISCONN +#define SOCK_EALREADY EALREADY +#define SOCK_EINVAL EINVAL +#define SOCK_EINTR EINTR +#define SOCK_EPIPE EPIPE + #endif /*osiSockH*/ diff --git a/src/libCom/osi/os/VMS/osiSock.h b/src/libCom/osi/os/VMS/osiSock.h index 9e2cebe30..8230473a4 100644 --- a/src/libCom/osi/os/VMS/osiSock.h +++ b/src/libCom/osi/os/VMS/osiSock.h @@ -13,33 +13,42 @@ extern "C" { #if defined(MULTINET) && defined(__cplusplus) struct iovec; #endif + #include #include #include #if defined(UCX) /* GeG 09-DEC-1992 */ # include -# include -# include +# include +# include # include -#else -# include -# include -# include -# if defined(MULTINET) && defined(__cplusplus) +#elif defined(MULTINET) +# if defined(__DECCXX) +# define __DECC 1 +# define __DECC_VER 999999999 +# include +# include +# undef __DECC +# undef __DECC_VER +# else +# include +# include +# endif +# if defined(__cplusplus) struct ifaddr; struct mbuf; # endif -# include -# include -# include +# include +# include +# include +# include # include #endif /* * MULTINET defines none of these (if not using C++) */ -#ifndef __cplusplus -#if 0 +#if defined(MULTINET) && defined(MULTINET_NO_PROTOTYPES) int gettimeofday (struct timeval *tp, struct timezone *tzp); int gethostname (char *name, int namelen); int accept (int socket, struct sockaddr *addr, int *addrlen); @@ -60,18 +69,20 @@ int getsockopt (int socket, int level, int optname, int recvfrom (int socket, char *buf, int len, int flags, struct sockaddr *from, int *fromlen); int getsockname (int socket, struct sockaddr *name, int *namelen); - -#endif /* if 0 */ - int listen (int socket, int backlog); int shutdown (int socket, int how); int socket (int domain, int type, int protocol); -#endif /* __cplusplus */ +#endif /* defined(MULTINET) && defined(MULTINET_NO_PROTOTYPES) */ void bzero (char *b, int length); -char * inet_ntoa (struct in_addr in); -unsigned long inet_addr (char *); +#ifdef MULTINET +# include + int gettimeofday (struct timeval *tp, ...); +#else + char * inet_ntoa (struct in_addr in); + unsigned long inet_addr (const char *); +#endif #if 0 struct hostent { @@ -103,21 +114,47 @@ typedef int SOCKET; # define socket_ioctl(A,B,C) ioctl(A,B,C) #endif - -#ifdef WINTCP /* Wallangong */ - extern int uerrno; +#if defined(WINTCP) /* Wallangong */ + extern int uerrno; # define SOCKERRNO uerrno +#elif defined(MULTINET) +# define SOCKERRNO socket_errno #else -# ifdef UCX -# define SOCKERRNO errno -# else -# define SOCKERRNO socket_errno -# endif +# define SOCKERRNO errno /* UCX and others? */ #endif +/* + * !! this is no doubt incorrect !! + * (error messages will be confusing until + * this is fixed) + */ +#define SOCKERRSTR (strerror(SOCKERRNO)) + #define MAXHOSTNAMELEN 75 -#define FD_IN_FDSET(FD) ((FD)=0) +#define SOCK_EWOULDBLOCK EWOULDBLOCK +#define SOCK_ENOBUFS ENOBUFS +#define SOCK_ECONNRESET ECONNRESET +#define SOCK_ETIMEDOUT ETIMEDOUT +#define SOCK_EADDRINUSE EADDRINUSE +#define SOCK_ECONNREFUSED ECONNREFUSED +#define SOCK_ECONNABORTED ECONNABORTED +#define SOCK_EINPROGRESS EINPROGRESS +#define SOCK_EISCONN EISCONN +#define SOCK_EALREADY EALREADY +#define SOCK_EINVAL EINVAL +#define SOCK_EINTR EINTR +#define SOCK_EPIPE EPIPE + +/* + * Under MULTINET FD_SETSIZE does not apply + * (can only guess about the others) + */ +#ifdef MULTINET +# define FD_IN_FDSET(FD) (1) +#else +# define FD_IN_FDSET(FD) ((FD)=0) +#endif #endif /*osiSockH*/ diff --git a/src/libCom/osi/os/WIN32/osdSock.h b/src/libCom/osi/os/WIN32/osdSock.h index 3c7de4a90..8c2af4f75 100644 --- a/src/libCom/osi/os/WIN32/osdSock.h +++ b/src/libCom/osi/os/WIN32/osdSock.h @@ -15,21 +15,31 @@ extern "C" { #endif #define SOCKERRNO WSAGetLastError() +/* + * I dont think that this works, but winsock does + * not appear to provide equivalent functionality + * here + */ +#define SOCKERRSTR (strerror(SOCKERRNO)) #define socket_close(S) closesocket(S) #define socket_ioctl(A,B,C) ioctlsocket(A,B,(unsigned long *) C) #define MAXHOSTNAMELEN 75 #define IPPORT_USERRESERVED 5000U -#define EWOULDBLOCK WSAEWOULDBLOCK -#define ENOBUFS WSAENOBUFS -#define ECONNRESET WSAECONNRESET -#define ETIMEDOUT WSAETIMEDOUT -#define EADDRINUSE WSAEADDRINUSE -#define ECONNREFUSED WSAECONNREFUSED -#define ECONNABORTED WSAECONNABORTED -#define EINPROGRESS WSAEINPROGRESS -#define EISCONN WSAEISCONN -#define EALREADY WSAEALREADY + +#define SOCK_EWOULDBLOCK WSAEWOULDBLOCK +#define SOCK_ENOBUFS WSAENOBUFS +#define SOCK_ECONNRESET WSAECONNRESET +#define SOCK_ETIMEDOUT WSAETIMEDOUT +#define SOCK_EADDRINUSE WSAEADDRINUSE +#define SOCK_ECONNREFUSED WSAECONNREFUSED +#define SOCK_ECONNABORTED WSAECONNABORTED +#define SOCK_EINPROGRESS WSAEINPROGRESS +#define SOCK_EISCONN WSAEISCONN +#define SOCK_EALREADY WSAEALREADY +#define SOCK_EINVAL WSAEINVAL +#define SOCK_EINTR WSAEINTR +#define SOCK_EPIPE EPIPE /* * Under WIN32, FD_SETSIZE is the max. number of sockets, diff --git a/src/libCom/osi/os/alpha/osdSock.h b/src/libCom/osi/os/alpha/osdSock.h index 9bd38beb7..d954dee79 100644 --- a/src/libCom/osi/os/alpha/osdSock.h +++ b/src/libCom/osi/os/alpha/osdSock.h @@ -40,10 +40,25 @@ int sethostname(char *name, int namelen); typedef int SOCKET; #define INVALID_SOCKET (-1) #define SOCKERRNO errno +#define SOCKERRSTR (strerror(errno)) #define socket_close(S) close(S) #define socket_ioctl(A,B,C) ioctl(A,B,C) #define FD_IN_FDSET(FD) ((FD)=0) +#define SOCK_EWOULDBLOCK EWOULDBLOCK +#define SOCK_ENOBUFS ENOBUFS +#define SOCK_ECONNRESET ECONNRESET +#define SOCK_ETIMEDOUT ETIMEDOUT +#define SOCK_EADDRINUSE EADDRINUSE +#define SOCK_ECONNREFUSED ECONNREFUSED +#define SOCK_ECONNABORTED ECONNABORTED +#define SOCK_EINPROGRESS EINPROGRESS +#define SOCK_EISCONN EISCONN +#define SOCK_EALREADY EALREADY +#define SOCK_EINVAL EINVAL +#define SOCK_EINTR EINTR +#define SOCK_EPIPE EPIPE + #endif /*osiSockH*/ diff --git a/src/libCom/osi/os/cygwin32/osdSock.h b/src/libCom/osi/os/cygwin32/osdSock.h index 8927f9a42..1de9336f3 100644 --- a/src/libCom/osi/os/cygwin32/osdSock.h +++ b/src/libCom/osi/os/cygwin32/osdSock.h @@ -36,6 +36,7 @@ int sethostname(char *name, int namelen); typedef int SOCKET; #define INVALID_SOCKET (-1) #define SOCKERRNO errno +#define SOCKERRSTR (strerror(errno)) #define socket_close(S) close(S) #define socket_ioctl(A,B,C) ioctl(A,B,C) @@ -63,5 +64,19 @@ typedef int SOCKET; #define SO_SNDBUF 0x1001 /* send buffer size */ #define SO_RCVBUF 0x1002 /* receive buffer size */ +#define SOCK_EWOULDBLOCK EWOULDBLOCK +#define SOCK_ENOBUFS ENOBUFS +#define SOCK_ECONNRESET ECONNRESET +#define SOCK_ETIMEDOUT ETIMEDOUT +#define SOCK_EADDRINUSE EADDRINUSE +#define SOCK_ECONNREFUSED ECONNREFUSED +#define SOCK_ECONNABORTED ECONNABORTED +#define SOCK_EINPROGRESS EINPROGRESS +#define SOCK_EISCONN EISCONN +#define SOCK_EALREADY EALREADY +#define SOCK_EINVAL EINVAL +#define SOCK_EINTR EINTR +#define SOCK_EPIPE EPIPE + #endif /*osiSockH*/ diff --git a/src/libCom/osi/os/hpux/osdSock.h b/src/libCom/osi/os/hpux/osdSock.h index a71a5dde9..b7e2718ab 100644 --- a/src/libCom/osi/os/hpux/osdSock.h +++ b/src/libCom/osi/os/hpux/osdSock.h @@ -44,10 +44,25 @@ int sethostname(char *name, int namelen); typedef int SOCKET; #define INVALID_SOCKET (-1) #define SOCKERRNO errno +#define SOCKERRSTR (strerror(errno)) #define socket_close(S) close(S) #define socket_ioctl(A,B,C) ioctl(A,B,C) #define FD_IN_FDSET(FD) ((FD)=0) +#define SOCK_EWOULDBLOCK EWOULDBLOCK +#define SOCK_ENOBUFS ENOBUFS +#define SOCK_ECONNRESET ECONNRESET +#define SOCK_ETIMEDOUT ETIMEDOUT +#define SOCK_EADDRINUSE EADDRINUSE +#define SOCK_ECONNREFUSED ECONNREFUSED +#define SOCK_ECONNABORTED ECONNABORTED +#define SOCK_EINPROGRESS EINPROGRESS +#define SOCK_EISCONN EISCONN +#define SOCK_EALREADY EALREADY +#define SOCK_EINVAL EINVAL +#define SOCK_EINTR EINTR +#define SOCK_EPIPE EPIPE + #endif /*osiSockH*/ diff --git a/src/libCom/osi/os/sgi/osdSock.h b/src/libCom/osi/os/sgi/osdSock.h index 217c5abdd..0ca4378cd 100644 --- a/src/libCom/osi/os/sgi/osdSock.h +++ b/src/libCom/osi/os/sgi/osdSock.h @@ -39,10 +39,25 @@ extern "C" { typedef int SOCKET; #define INVALID_SOCKET (-1) #define SOCKERRNO errno +#define SOCKERRSTR (strerror(errno)) #define socket_close(S) close(S) #define socket_ioctl(A,B,C) ioctl(A,B,C) #define FD_IN_FDSET(FD) ((FD)=0) +#define SOCK_EWOULDBLOCK EWOULDBLOCK +#define SOCK_ENOBUFS ENOBUFS +#define SOCK_ECONNRESET ECONNRESET +#define SOCK_ETIMEDOUT ETIMEDOUT +#define SOCK_EADDRINUSE EADDRINUSE +#define SOCK_ECONNREFUSED ECONNREFUSED +#define SOCK_ECONNABORTED ECONNABORTED +#define SOCK_EINPROGRESS EINPROGRESS +#define SOCK_EISCONN EISCONN +#define SOCK_EALREADY EALREADY +#define SOCK_EINVAL EINVAL +#define SOCK_EINTR EINTR +#define SOCK_EPIPE EPIPE + #endif /*osiSockH*/ diff --git a/src/libCom/osi/os/solaris/osdSock.h b/src/libCom/osi/os/solaris/osdSock.h index c6fe10f71..37a2278e8 100644 --- a/src/libCom/osi/os/solaris/osdSock.h +++ b/src/libCom/osi/os/solaris/osdSock.h @@ -50,10 +50,25 @@ int sethostname(char *name, int namelen); typedef int SOCKET; #define INVALID_SOCKET (-1) #define SOCKERRNO errno +#define SOCKERRSTR (strerror(errno)) #define socket_close(S) close(S) #define socket_ioctl(A,B,C) ioctl(A,B,C) #define FD_IN_FDSET(FD) ((FD)=0) +#define SOCK_EWOULDBLOCK EWOULDBLOCK +#define SOCK_ENOBUFS ENOBUFS +#define SOCK_ECONNRESET ECONNRESET +#define SOCK_ETIMEDOUT ETIMEDOUT +#define SOCK_EADDRINUSE EADDRINUSE +#define SOCK_ECONNREFUSED ECONNREFUSED +#define SOCK_ECONNABORTED ECONNABORTED +#define SOCK_EINPROGRESS EINPROGRESS +#define SOCK_EISCONN EISCONN +#define SOCK_EALREADY EALREADY +#define SOCK_EINVAL EINVAL +#define SOCK_EINTR EINTR +#define SOCK_EPIPE EPIPE + #endif /*osiSockH*/ diff --git a/src/libCom/osi/os/sun4/osdSock.h b/src/libCom/osi/os/sun4/osdSock.h index c29412c8a..b2be3247a 100644 --- a/src/libCom/osi/os/sun4/osdSock.h +++ b/src/libCom/osi/os/sun4/osdSock.h @@ -89,6 +89,7 @@ int gethostname (char *name, int namelen); typedef int SOCKET; #define INVALID_SOCKET (-1) #define SOCKERRNO errno +#define SOCKERRSTR (strerror(errno)) #define socket_close(S) close(S) #define socket_ioctl(A,B,C) ioctl(A,B,C) @@ -99,5 +100,19 @@ typedef int SOCKET; #define FD_IN_FDSET(FD) ((FD)=0) +#define SOCK_EWOULDBLOCK EWOULDBLOCK +#define SOCK_ENOBUFS ENOBUFS +#define SOCK_ECONNRESET ECONNRESET +#define SOCK_ETIMEDOUT ETIMEDOUT +#define SOCK_EADDRINUSE EADDRINUSE +#define SOCK_ECONNREFUSED ECONNREFUSED +#define SOCK_ECONNABORTED ECONNABORTED +#define SOCK_EINPROGRESS EINPROGRESS +#define SOCK_EISCONN EISCONN +#define SOCK_EALREADY EALREADY +#define SOCK_EINVAL EINVAL +#define SOCK_EINTR EINTR +#define SOCK_EPIPE EPIPE + #endif /*osiSockH*/ diff --git a/src/libCom/osi/os/vxWorks/osdSock.h b/src/libCom/osi/os/vxWorks/osdSock.h index cde99b4d2..4f099c910 100644 --- a/src/libCom/osi/os/vxWorks/osdSock.h +++ b/src/libCom/osi/os/vxWorks/osdSock.h @@ -28,11 +28,26 @@ extern "C" { typedef int SOCKET; #define INVALID_SOCKET (-1) #define SOCKERRNO errno +#define SOCKERRSTR (strerror(SOCKERRNO)) #define socket_close(S) close(S) #define socket_ioctl(A,B,C) ioctl(A,B,(int)C) #define FD_IN_FDSET(FD) ((FD)=0) +#define SOCK_EWOULDBLOCK EWOULDBLOCK +#define SOCK_ENOBUFS ENOBUFS +#define SOCK_ECONNRESET ECONNRESET +#define SOCK_ETIMEDOUT ETIMEDOUT +#define SOCK_EADDRINUSE EADDRINUSE +#define SOCK_ECONNREFUSED ECONNREFUSED +#define SOCK_ECONNABORTED ECONNABORTED +#define SOCK_EINPROGRESS EINPROGRESS +#define SOCK_EISCONN EISCONN +#define SOCK_EALREADY EALREADY +#define SOCK_EINVAL EINVAL +#define SOCK_EINTR EINTR +#define SOCK_EPIPE EPIPE + #endif /*osiSockH*/