Go to the source code of this file.
Defines | |
#define | close(a) _close(a) |
#define | read(a, b, c) _read(a,b,c) |
#define | write(a, b, c) _write(a,b,c) |
#define | EINTR WSAEINTR |
#define | EWOULDBLOCK WSAEWOULDBLOCK |
#define | ECONNRESET WSAECONNRESET |
#define | EINPROGRESS WSAEINPROGRESS |
Functions | |
const char * | winsock_strerror (int err, char *strerrbuf, size_t buflen) |
#define close | ( | a | ) | _close(a) |
Definition at line 17 of file win32.h.
Referenced by AddToDataDirLockFile(), BootStrapXLOG(), CheckForExternalTrigger(), close_walfile(), ClosePostmasterPorts(), CloseTransientFile(), copy_file(), copyAndUpdateFile(), count_usable_fds(), CreateLockFile(), DebugFileOpen(), existsTimeLineHistoryFile(), exitArchiveRecovery(), exportFile(), FileClose(), fork_process(), FreeDesc(), fsync_fname(), GetNewRelFileNode(), importFile(), lo_export(), lo_import_internal(), LruDelete(), main(), open_walfile(), pid_lock_file_exists(), pre_sync_fname(), PreallocXlogFiles(), pthread_create(), pthread_join(), ReadControlFile(), readfile(), ReadRecord(), ReceiveXlogStream(), RewriteControlFile(), saveHistory(), StartupXLOG(), SysLogger_Start(), SysLoggerMain(), test_file_descriptor_sync(), test_non_sync(), test_open(), test_open_sync(), test_sync(), TouchSocketLockFiles(), transfer_relfile(), tzload(), UpdateControlFile(), WaitForWALToBecomeAvailable(), WalReceiverMain(), WalSndErrorCleanup(), WriteControlFile(), WriteEmptyXLOG(), writeTimeLineHistoryFile(), XLogDumpXLogRead(), XLogFileClose(), XLogFileInit(), XLogPageRead(), XLogRead(), XLogSend(), and XLogWalRcvWrite().
Definition at line 18 of file win32.h.
Referenced by AddToDataDirLockFile(), CheckForExternalTrigger(), copy_file(), copyAndUpdateFile(), CreateLockFile(), drainSelfPipe(), FileRead(), importFile(), lo_import_internal(), load_relmap_file(), main(), PostmasterIsAlive(), pthread_join(), reached_end_position(), ReadControlFile(), readfile(), ReadTwoPhaseFile(), SendTimeLineHistory(), SlruPhysicalReadPage(), SysLoggerMain(), TouchSocketLockFiles(), tzload(), writeTimeLineHistory(), XLogDumpXLogRead(), XLogFileCopy(), XLogPageRead(), and XLogRead().
Definition at line 19 of file win32.h.
Referenced by AddToDataDirLockFile(), BaseBackup(), BootStrapXLOG(), copy_file(), copyAndUpdateFile(), CreateLockFile(), EndPrepare(), exportFile(), FileWrite(), fork_process(), HandleCopyStream(), lo_export(), open_walfile(), pthread_create(), RecreateTwoPhaseFile(), RewriteControlFile(), sendSelfPipeByte(), SlruPhysicalWritePage(), test_file_descriptor_sync(), test_non_sync(), test_open(), test_open_sync(), test_sync(), UpdateControlFile(), write_console(), write_pipe_chunks(), write_relmap_file(), WriteControlFile(), WriteEmptyXLOG(), writeTimeLineHistory(), writeTimeLineHistoryFile(), XLogFileCopy(), XLogFileInit(), XLogWalRcvWrite(), and XLogWrite().
const char* winsock_strerror | ( | int | err, | |
char * | strerrbuf, | |||
size_t | buflen | |||
) |
Definition at line 286 of file win32.c.
References dlls, MessageDLL::handle, i, libpq_gettext, MessageDLL::loaded, and LookupWSErrorMessage().
{ unsigned long flags; int offs, i; int success = LookupWSErrorMessage(err, strerrbuf); for (i = 0; !success && i < DLLS_SIZE; i++) { if (!dlls[i].loaded) { dlls[i].loaded = 1; /* Only load once */ dlls[i].handle = (void *) LoadLibraryEx( dlls[i].dll_name, 0, LOAD_LIBRARY_AS_DATAFILE); } if (dlls[i].dll_name && !dlls[i].handle) continue; /* Didn't load */ flags = FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS | (dlls[i].handle ? FORMAT_MESSAGE_FROM_HMODULE : 0); success = 0 != FormatMessage( flags, dlls[i].handle, err, MAKELANGID(LANG_ENGLISH, SUBLANG_DEFAULT), strerrbuf, buflen - 64, 0 ); } if (!success) sprintf(strerrbuf, libpq_gettext("unrecognized socket error: 0x%08X/%d"), err, err); else { strerrbuf[buflen - 1] = '\0'; offs = strlen(strerrbuf); if (offs > (int) buflen - 64) offs = buflen - 64; sprintf(strerrbuf + offs, " (0x%08X/%d)", err, err); } return strerrbuf; }