summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorJan Dubois <jand@activestate.com>2009-11-11 15:29:39 -0800
committerJan Dubois <jand@activestate.com>2009-11-11 15:29:39 -0800
commit2489f03d17f65312c4370377c30587ab801b844f (patch)
tree3999b6b3eb079d136153f4acd11c7d1bf6ba6485 /ext
parentda80cd87614d1347c811f58b124b84de7a7b192a (diff)
downloadperl-2489f03d17f65312c4370377c30587ab801b844f.tar.gz
Map winsock error codes to POSIX errno values
Diffstat (limited to 'ext')
-rw-r--r--ext/POSIX/POSIX.xs123
1 files changed, 123 insertions, 0 deletions
diff --git a/ext/POSIX/POSIX.xs b/ext/POSIX/POSIX.xs
index eccbb3170d..5b7ade69ce 100644
--- a/ext/POSIX/POSIX.xs
+++ b/ext/POSIX/POSIX.xs
@@ -216,6 +216,129 @@ char *tzname[] = { "" , "" };
#endif /* WIN32 || NETWARE */
#endif /* __VMS */
+#ifdef WIN32
+ /* Perl on Windows assigns WSAGetLastError() return values to errno
+ * (in win32/win32sck.c). Therefore we need to map these values
+ * back to standard symbolic names, as long as the same name isn't
+ * already defined by errno.h itself. The Errno.pm module does
+ * a similar mapping.
+ */
+# ifndef EWOULDBLOCK
+# define EWOULDBLOCK WSAEWOULDBLOCK
+# endif
+# ifndef EINPROGRESS
+# define EINPROGRESS WSAEINPROGRESS
+# endif
+# ifndef EALREADY
+# define EALREADY WSAEALREADY
+# endif
+# ifndef ENOTSOCK
+# define ENOTSOCK WSAENOTSOCK
+# endif
+# ifndef EDESTADDRREQ
+# define EDESTADDRREQ WSAEDESTADDRREQ
+# endif
+# ifndef EMSGSIZE
+# define EMSGSIZE WSAEMSGSIZE
+# endif
+# ifndef EPROTOTYPE
+# define EPROTOTYPE WSAEPROTOTYPE
+# endif
+# ifndef ENOPROTOOPT
+# define ENOPROTOOPT WSAENOPROTOOPT
+# endif
+# ifndef EPROTONOSUPPORT
+# define EPROTONOSUPPORT WSAEPROTONOSUPPORT
+# endif
+# ifndef ESOCKTNOSUPPORT
+# define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT
+# endif
+# ifndef EOPNOTSUPP
+# define EOPNOTSUPP WSAEOPNOTSUPP
+# endif
+# ifndef EPFNOSUPPORT
+# define EPFNOSUPPORT WSAEPFNOSUPPORT
+# endif
+# ifndef EAFNOSUPPORT
+# define EAFNOSUPPORT WSAEAFNOSUPPORT
+# endif
+# ifndef EADDRINUSE
+# define EADDRINUSE WSAEADDRINUSE
+# endif
+# ifndef EADDRNOTAVAIL
+# define EADDRNOTAVAIL WSAEADDRNOTAVAIL
+# endif
+# ifndef ENETDOWN
+# define ENETDOWN WSAENETDOWN
+# endif
+# ifndef ENETUNREACH
+# define ENETUNREACH WSAENETUNREACH
+# endif
+# ifndef ENETRESET
+# define ENETRESET WSAENETRESET
+# endif
+# ifndef ECONNABORTED
+# define ECONNABORTED WSAECONNABORTED
+# endif
+# ifndef ECONNRESET
+# define ECONNRESET WSAECONNRESET
+# endif
+# ifndef ENOBUFS
+# define ENOBUFS WSAENOBUFS
+# endif
+# ifndef EISCONN
+# define EISCONN WSAEISCONN
+# endif
+# ifndef ENOTCONN
+# define ENOTCONN WSAENOTCONN
+# endif
+# ifndef ESHUTDOWN
+# define ESHUTDOWN WSAESHUTDOWN
+# endif
+# ifndef ETOOMANYREFS
+# define ETOOMANYREFS WSAETOOMANYREFS
+# endif
+# ifndef ETIMEDOUT
+# define ETIMEDOUT WSAETIMEDOUT
+# endif
+# ifndef ECONNREFUSED
+# define ECONNREFUSED WSAECONNREFUSED
+# endif
+# ifndef ELOOP
+# define ELOOP WSAELOOP
+# endif
+# ifndef ENAMETOOLONG
+# define ENAMETOOLONG WSAENAMETOOLONG
+# endif
+# ifndef EHOSTDOWN
+# define EHOSTDOWN WSAEHOSTDOWN
+# endif
+# ifndef EHOSTUNREACH
+# define EHOSTUNREACH WSAEHOSTUNREACH
+# endif
+# ifndef ENOTEMPTY
+# define ENOTEMPTY WSAENOTEMPTY
+# endif
+# ifndef EPROCLIM
+# define EPROCLIM WSAEPROCLIM
+# endif
+# ifndef EUSERS
+# define EUSERS WSAEUSERS
+# endif
+# ifndef EDQUOT
+# define EDQUOT WSAEDQUOT
+# endif
+# ifndef ESTALE
+# define ESTALE WSAESTALE
+# endif
+# ifndef EREMOTE
+# define EREMOTE WSAEREMOTE
+# endif
+# ifndef EDISCON
+# define EDISCON WSAEDISCON
+# endif
+#endif
+
typedef int SysRet;
typedef long SysRetLong;
typedef sigset_t* POSIX__SigSet;