This commit is contained in:
Manoj Ampalam 2016-03-04 14:13:11 -08:00
parent 826d79e297
commit 2caf350f29
4 changed files with 37 additions and 0 deletions

View File

@ -18,3 +18,4 @@
#define recv w32_recv
#define send w32_send
#define shutdown w32_shutdown
#define socketpair w32_socketpair

View File

@ -14,3 +14,5 @@
#define close w32_close
#define dup w32_dup
#define dup2 w32_dup2
#define sleep(sec) Sleep(1000 * sec)

View File

@ -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

View File

@ -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) {