diff --git a/contrib/win32/w32-posix-prototype/win32posix/win32posix/inc/sys/socket.h b/contrib/win32/w32-posix-prototype/win32posix/win32posix/inc/sys/socket.h index 614ca07..d8f5072 100644 --- a/contrib/win32/w32-posix-prototype/win32posix/win32posix/inc/sys/socket.h +++ b/contrib/win32/w32-posix-prototype/win32posix/win32posix/inc/sys/socket.h @@ -18,3 +18,4 @@ #define recv w32_recv #define send w32_send #define shutdown w32_shutdown +#define socketpair w32_socketpair diff --git a/contrib/win32/w32-posix-prototype/win32posix/win32posix/inc/unistd.h b/contrib/win32/w32-posix-prototype/win32posix/win32posix/inc/unistd.h index 5161076..4888ba5 100644 --- a/contrib/win32/w32-posix-prototype/win32posix/win32posix/inc/unistd.h +++ b/contrib/win32/w32-posix-prototype/win32posix/win32posix/inc/unistd.h @@ -14,3 +14,5 @@ #define close w32_close #define dup w32_dup #define dup2 w32_dup2 + +#define sleep(sec) Sleep(1000 * sec) \ No newline at end of file diff --git a/contrib/win32/w32-posix-prototype/win32posix/win32posix/inc/w32posix.h b/contrib/win32/w32-posix-prototype/win32posix/win32posix/inc/w32posix.h index ec45d56..43cd2a1 100644 --- a/contrib/win32/w32-posix-prototype/win32posix/win32posix/inc/w32posix.h +++ b/contrib/win32/w32-posix-prototype/win32posix/win32posix/inc/w32posix.h @@ -33,6 +33,7 @@ int w32_connect(int fd, const struct sockaddr* name, int namelen); int w32_recv(int fd, void *buf, size_t len, int flags); int w32_send(int fd, const void *buf, size_t len, int flags); int w32_shutdown(int fd, int how); +int w32_socketpair(int domain, int type, int sv[2]); /*non-network (file) i/o*/ #define fdopen w32_fdopen @@ -53,4 +54,30 @@ int w32_dup(int oldfd); int w32_dup2(int oldfd, int newfd); +/* Shutdown constants */ +#define SHUT_WR SD_SEND +#define SHUT_RD SD_RECEIVE +#define SHUT_RDWR SD_BOTH + +/* Other constants */ +#define IN_LOOPBACKNET 127 /* 127.* is the loopback network */ +#define MAXHOSTNAMELEN 64 + + +/* Errno helpers */ +#ifndef EXX +#define EXX WSAEMFILE +#endif +#ifndef EXX1 +#define EXX1 WSAENOBUFS +#endif +#ifndef ESOCKTNOSUPPORT +#define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT +#endif +#ifndef ENOTUNREACH +#define ENOTUNREACH WSAENOTUNREACH +#endif +#ifndef EPFNOSUPPORT +#define EPFNOSUPPORT WSAEPFNOSUPPORT +#endif diff --git a/contrib/win32/w32-posix-prototype/win32posix/win32posix/w32fd.c b/contrib/win32/w32-posix-prototype/win32posix/win32posix/w32fd.c index 19895da..77b737c 100644 --- a/contrib/win32/w32-posix-prototype/win32posix/win32posix/w32fd.c +++ b/contrib/win32/w32-posix-prototype/win32posix/win32posix/w32fd.c @@ -271,6 +271,13 @@ w32_shutdown(int fd, int how) { return socketio_shutdown(fd_table.w32_ios[fd], how); } +int +w32_socketpair(int domain, int type, int sv[2]) { + errno = ENOTSUP; + debug("ERROR:%d", errno); + return -1; +} + int w32_pipe(int *pfds) {