~ubuntu-branches/ubuntu/trusty/postgresql-9.3/trusty-updates

« back to all changes in this revision

Viewing changes to src/include/port/win32.h

  • Committer: Package Import Robot
  • Author(s): Martin Pitt
  • Date: 2016-05-12 16:06:03 UTC
  • mfrom: (1.1.16) (19.1.4 trusty-proposed)
  • Revision ID: package-import@ubuntu.com-20160512160603-8h0t7au3bkfjuiv4
Tags: 9.3.13-0ubuntu0.14.04
* New upstream bug fix release. (LP: #1581016)
  - See http://www.postgresql.org/docs/9.3/static/release-9-3-13.html for
    details.

Show diffs side-by-side

added added

removed removed

Lines of Context:
267
267
 
268
268
/*
269
269
 * Supplement to <errno.h>.
 
270
 *
 
271
 * We redefine network-related Berkeley error symbols as the corresponding WSA
 
272
 * constants.  This allows elog.c to recognize them as being in the Winsock
 
273
 * error code range and pass them off to pgwin32_socket_strerror(), since
 
274
 * Windows' version of plain strerror() won't cope.  Note that this will break
 
275
 * if these names are used for anything else besides Windows Sockets errors.
 
276
 * See TranslateSocketError() when changing this list.
270
277
 */
271
278
#undef EAGAIN
 
279
#define EAGAIN WSAEWOULDBLOCK
272
280
#undef EINTR
273
281
#define EINTR WSAEINTR
274
 
#define EAGAIN WSAEWOULDBLOCK
275
282
#undef EMSGSIZE
276
283
#define EMSGSIZE WSAEMSGSIZE
277
284
#undef EAFNOSUPPORT
278
285
#define EAFNOSUPPORT WSAEAFNOSUPPORT
279
286
#undef EWOULDBLOCK
280
287
#define EWOULDBLOCK WSAEWOULDBLOCK
 
288
#undef ECONNABORTED
 
289
#define ECONNABORTED WSAECONNABORTED
281
290
#undef ECONNRESET
282
291
#define ECONNRESET WSAECONNRESET
283
292
#undef EINPROGRESS
284
293
#define EINPROGRESS WSAEINPROGRESS
 
294
#undef EISCONN
 
295
#define EISCONN WSAEISCONN
285
296
#undef ENOBUFS
286
297
#define ENOBUFS WSAENOBUFS
287
298
#undef EPROTONOSUPPORT
288
299
#define EPROTONOSUPPORT WSAEPROTONOSUPPORT
289
300
#undef ECONNREFUSED
290
301
#define ECONNREFUSED WSAECONNREFUSED
291
 
#undef EBADFD
292
 
#define EBADFD WSAENOTSOCK
 
302
#undef ENOTSOCK
 
303
#define ENOTSOCK WSAENOTSOCK
293
304
#undef EOPNOTSUPP
294
305
#define EOPNOTSUPP WSAEOPNOTSUPP
295
 
 
296
 
/*
297
 
 * For Microsoft Visual Studio 2010 and above we intentionally redefine
298
 
 * the regular Berkeley error constants and set them to the WSA constants.
299
 
 * Note that this will break if those constants are used for anything else
300
 
 * than Windows Sockets errors.
301
 
 */
302
 
#if _MSC_VER >= 1600
303
 
#pragma warning(disable:4005)
304
 
#define EMSGSIZE WSAEMSGSIZE
305
 
#define EAFNOSUPPORT WSAEAFNOSUPPORT
306
 
#define EWOULDBLOCK WSAEWOULDBLOCK
307
 
#define EPROTONOSUPPORT WSAEPROTONOSUPPORT
308
 
#define ECONNRESET WSAECONNRESET
309
 
#define EINPROGRESS WSAEINPROGRESS
310
 
#define ENOBUFS WSAENOBUFS
311
 
#define ECONNREFUSED WSAECONNREFUSED
312
 
#define EOPNOTSUPP WSAEOPNOTSUPP
313
 
#pragma warning(default:4005)
314
 
#endif
 
306
#undef EADDRINUSE
 
307
#define EADDRINUSE WSAEADDRINUSE
 
308
#undef EADDRNOTAVAIL
 
309
#define EADDRNOTAVAIL WSAEADDRNOTAVAIL
 
310
#undef EHOSTUNREACH
 
311
#define EHOSTUNREACH WSAEHOSTUNREACH
 
312
#undef ENOTCONN
 
313
#define ENOTCONN WSAENOTCONN
315
314
 
316
315
/*
317
316
 * Extended locale functions with gratuitous underscore prefixes.
363
362
/* In backend/port/win32/socket.c */
364
363
#ifndef FRONTEND
365
364
#define socket(af, type, protocol) pgwin32_socket(af, type, protocol)
 
365
#define bind(s, addr, addrlen) pgwin32_bind(s, addr, addrlen)
 
366
#define listen(s, backlog) pgwin32_listen(s, backlog)
366
367
#define accept(s, addr, addrlen) pgwin32_accept(s, addr, addrlen)
367
368
#define connect(s, name, namelen) pgwin32_connect(s, name, namelen)
368
369
#define select(n, r, w, e, timeout) pgwin32_select(n, r, w, e, timeout)
370
371
#define send(s, buf, len, flags) pgwin32_send(s, buf, len, flags)
371
372
 
372
373
SOCKET          pgwin32_socket(int af, int type, int protocol);
 
374
int                     pgwin32_bind(SOCKET s, struct sockaddr * addr, int addrlen);
 
375
int                     pgwin32_listen(SOCKET s, int backlog);
373
376
SOCKET          pgwin32_accept(SOCKET s, struct sockaddr * addr, int *addrlen);
374
377
int                     pgwin32_connect(SOCKET s, const struct sockaddr * name, int namelen);
375
378
int                     pgwin32_select(int nfds, fd_set *readfs, fd_set *writefds, fd_set *exceptfds, const struct timeval * timeout);