Ignore not-yet-defined Portals in pg_cursors view.
[pgsql.git] / src / port / win32gai_strerror.c
blob5b47d1722df346830d9284d5ca5ee4d66fc9a4d0
1 /*-------------------------------------------------------------------------
3 * win32gai_strerror.c
4 * Thread-safe gai_strerror() for Windows.
6 * Portions Copyright (c) 2024, PostgreSQL Global Development Group
8 * IDENTIFICATION
9 * src/port/win32gai_strerror.c
11 *-------------------------------------------------------------------------
14 #include <sys/socket.h>
17 * Windows has gai_strerrorA(), but it is not thread-safe so we avoid it.
19 * https://learn.microsoft.com/en-us/windows/win32/api/ws2tcpip/nf-ws2tcpip-gai_strerrora
21 const char *
22 gai_strerror(int errcode)
24 switch (errcode)
26 case EAI_AGAIN:
27 return "Temporary failure in name resolution";
28 case EAI_BADFLAGS:
29 return "Bad value for ai_flags";
30 case EAI_FAIL:
31 return "Non-recoverable failure in name resolution";
32 case EAI_FAMILY:
33 return "ai_family not supported";
34 case EAI_MEMORY:
35 return "Memory allocation failure";
36 case EAI_NONAME:
37 return "Name or service not known";
38 case EAI_SERVICE:
39 return "Servname not supported for ai_socktype";
40 case EAI_SOCKTYPE:
41 return "ai_socktype not supported";
42 default:
43 return "Unknown server error";