diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2016-04-21 15:44:18 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2016-04-21 15:44:18 -0400 |
commit | 8f9518414baccac15bb028312f8db3b98e527c5c (patch) | |
tree | a2e33a27f992cda50c2f8a07b493fd7bb0474239 /src/include/port/win32.h | |
parent | e5882f26b38c6510a22263566548060a3153cc09 (diff) |
Provide errno-translation wrappers around bind() and listen() on Windows.
Fix Windows builds to report something useful rather than "could not bind
IPv4 socket: No error" when bind() fails.
Back-patch of commits d1b7d4877b9a71f4 and 22989a8e34168f57.
Discussion: <4065.1452450340@sss.pgh.pa.us>
Diffstat (limited to 'src/include/port/win32.h')
-rw-r--r-- | src/include/port/win32.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/include/port/win32.h b/src/include/port/win32.h index 550c3ecff42..faccca56de0 100644 --- a/src/include/port/win32.h +++ b/src/include/port/win32.h @@ -363,6 +363,8 @@ void pg_queue_signal(int signum); /* In backend/port/win32/socket.c */ #ifndef FRONTEND #define socket(af, type, protocol) pgwin32_socket(af, type, protocol) +#define bind(s, addr, addrlen) pgwin32_bind(s, addr, addrlen) +#define listen(s, backlog) pgwin32_listen(s, backlog) #define accept(s, addr, addrlen) pgwin32_accept(s, addr, addrlen) #define connect(s, name, namelen) pgwin32_connect(s, name, namelen) #define select(n, r, w, e, timeout) pgwin32_select(n, r, w, e, timeout) @@ -370,6 +372,8 @@ void pg_queue_signal(int signum); #define send(s, buf, len, flags) pgwin32_send(s, buf, len, flags) SOCKET pgwin32_socket(int af, int type, int protocol); +int pgwin32_bind(SOCKET s, struct sockaddr * addr, int addrlen); +int pgwin32_listen(SOCKET s, int backlog); SOCKET pgwin32_accept(SOCKET s, struct sockaddr * addr, int *addrlen); int pgwin32_connect(SOCKET s, const struct sockaddr * name, int namelen); int pgwin32_select(int nfds, fd_set *readfs, fd_set *writefds, fd_set *exceptfds, const struct timeval * timeout); |