PostgreSQL Source Code  git master
win32_port.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * win32_port.h
4  * Windows-specific compatibility stuff.
5  *
6  * Note this is read in MinGW as well as native Windows builds,
7  * but not in Cygwin builds.
8  *
9  * Portions Copyright (c) 1996-2021, PostgreSQL Global Development Group
10  * Portions Copyright (c) 1994, Regents of the University of California
11  *
12  * src/include/port/win32_port.h
13  *
14  *-------------------------------------------------------------------------
15  */
16 #ifndef PG_WIN32_PORT_H
17 #define PG_WIN32_PORT_H
18 
19 /*
20  * Always build with SSPI support. Keep it as a #define in case
21  * we want a switch to disable it sometime in the future.
22  */
23 #define ENABLE_SSPI 1
24 
25 /* undefine and redefine after #include */
26 #undef mkdir
27 
28 #undef ERROR
29 
30 /*
31  * VS2013 and later issue warnings about using the old Winsock API,
32  * which we don't really want to hear about.
33  */
34 #ifdef _MSC_VER
35 #define _WINSOCK_DEPRECATED_NO_WARNINGS
36 #endif
37 
38 /*
39  * The MinGW64 headers choke if this is already defined - they
40  * define it themselves.
41  */
42 #if !defined(__MINGW64_VERSION_MAJOR) || defined(_MSC_VER)
43 #define _WINSOCKAPI_
44 #endif
45 
46 /*
47  * windows.h includes a lot of other headers, slowing down compilation
48  * significantly. WIN32_LEAN_AND_MEAN reduces that a bit. It'd be better to
49  * remove the include of windows.h (as well as indirect inclusions of it) from
50  * such a central place, but until then...
51  */
52 #define WIN32_LEAN_AND_MEAN
53 
54 #include <winsock2.h>
55 #include <ws2tcpip.h>
56 #include <windows.h>
57 #undef small
58 #include <process.h>
59 #include <signal.h>
60 #include <direct.h>
61 #undef near
62 
63 /* needed before sys/stat hacking below: */
64 #define fstat microsoft_native_fstat
65 #define stat microsoft_native_stat
66 #include <sys/stat.h>
67 #undef fstat
68 #undef stat
69 
70 /* Must be here to avoid conflicting with prototype in windows.h */
71 #define mkdir(a,b) mkdir(a)
72 
73 #define ftruncate(a,b) chsize(a,b)
74 
75 /* Windows doesn't have fsync() as such, use _commit() */
76 #define fsync(fd) _commit(fd)
77 
78 /*
79  * For historical reasons, we allow setting wal_sync_method to
80  * fsync_writethrough on Windows, even though it's really identical to fsync
81  * (both code paths wind up at _commit()).
82  */
83 #define HAVE_FSYNC_WRITETHROUGH
84 #define FSYNC_WRITETHROUGH_IS_FSYNC
85 
86 #define USES_WINSOCK
87 
88 /*
89  * IPC defines
90  */
91 #undef HAVE_UNION_SEMUN
92 #define HAVE_UNION_SEMUN 1
93 
94 #define IPC_RMID 256
95 #define IPC_CREAT 512
96 #define IPC_EXCL 1024
97 #define IPC_PRIVATE 234564
98 #define IPC_NOWAIT 2048
99 #define IPC_STAT 4096
100 
101 #define EACCESS 2048
102 #ifndef EIDRM
103 #define EIDRM 4096
104 #endif
105 
106 #define SETALL 8192
107 #define GETNCNT 16384
108 #define GETVAL 65536
109 #define SETVAL 131072
110 #define GETPID 262144
111 
112 
113 /*
114  * Signal stuff
115  *
116  * For WIN32, there is no wait() call so there are no wait() macros
117  * to interpret the return value of system(). Instead, system()
118  * return values < 0x100 are used for exit() termination, and higher
119  * values are used to indicate non-exit() termination, which is
120  * similar to a unix-style signal exit (think SIGSEGV ==
121  * STATUS_ACCESS_VIOLATION). Return values are broken up into groups:
122  *
123  * https://docs.microsoft.com/en-us/windows-hardware/drivers/kernel/using-ntstatus-values
124  *
125  * NT_SUCCESS 0 - 0x3FFFFFFF
126  * NT_INFORMATION 0x40000000 - 0x7FFFFFFF
127  * NT_WARNING 0x80000000 - 0xBFFFFFFF
128  * NT_ERROR 0xC0000000 - 0xFFFFFFFF
129  *
130  * Effectively, we don't care on the severity of the return value from
131  * system(), we just need to know if it was because of exit() or generated
132  * by the system, and it seems values >= 0x100 are system-generated.
133  * See this URL for a list of WIN32 STATUS_* values:
134  *
135  * Wine (URL used in our error messages) -
136  * http://source.winehq.org/source/include/ntstatus.h
137  * Descriptions -
138  * https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-erref/596a1078-e883-4972-9bbc-49e60bebca55
139  *
140  * The comprehensive exception list is included in ntstatus.h from the
141  * Windows Driver Kit (WDK). A subset of the list is also included in
142  * winnt.h from the Windows SDK. Defining WIN32_NO_STATUS before including
143  * windows.h helps to avoid any conflicts.
144  *
145  * Some day we might want to print descriptions for the most common
146  * exceptions, rather than printing an include file name. We could use
147  * RtlNtStatusToDosError() and pass to FormatMessage(), which can print
148  * the text of error values, but MinGW does not support
149  * RtlNtStatusToDosError().
150  */
151 #define WIFEXITED(w) (((w) & 0XFFFFFF00) == 0)
152 #define WIFSIGNALED(w) (!WIFEXITED(w))
153 #define WEXITSTATUS(w) (w)
154 #define WTERMSIG(w) (w)
155 
156 #define sigmask(sig) ( 1 << ((sig)-1) )
157 
158 /* Signal function return values */
159 #undef SIG_DFL
160 #undef SIG_ERR
161 #undef SIG_IGN
162 #define SIG_DFL ((pqsigfunc)0)
163 #define SIG_ERR ((pqsigfunc)-1)
164 #define SIG_IGN ((pqsigfunc)1)
165 
166 /* Some extra signals */
167 #define SIGHUP 1
168 #define SIGQUIT 3
169 #define SIGTRAP 5
170 #define SIGABRT 22 /* Set to match W32 value -- not UNIX value */
171 #define SIGKILL 9
172 #define SIGPIPE 13
173 #define SIGALRM 14
174 #define SIGSTOP 17
175 #define SIGTSTP 18
176 #define SIGCONT 19
177 #define SIGCHLD 20
178 #define SIGWINCH 28
179 #define SIGUSR1 30
180 #define SIGUSR2 31
181 
182 /*
183  * New versions of MinGW have gettimeofday() and also declare
184  * struct timezone to support it.
185  */
186 #ifndef HAVE_GETTIMEOFDAY
187 struct timezone
188 {
189  int tz_minuteswest; /* Minutes west of GMT. */
190  int tz_dsttime; /* Nonzero if DST is ever in effect. */
191 };
192 #endif
193 
194 /* for setitimer in backend/port/win32/timer.c */
195 #define ITIMER_REAL 0
196 struct itimerval
197 {
198  struct timeval it_interval;
199  struct timeval it_value;
200 };
201 
202 int setitimer(int which, const struct itimerval *value, struct itimerval *ovalue);
203 
204 /*
205  * WIN32 does not provide 64-bit off_t, but does provide the functions operating
206  * with 64-bit offsets.
207  */
208 #define pgoff_t __int64
209 
210 #ifdef _MSC_VER
211 #define fseeko(stream, offset, origin) _fseeki64(stream, offset, origin)
212 #define ftello(stream) _ftelli64(stream)
213 #else
214 #ifndef fseeko
215 #define fseeko(stream, offset, origin) fseeko64(stream, offset, origin)
216 #endif
217 #ifndef ftello
218 #define ftello(stream) ftello64(stream)
219 #endif
220 #endif
221 
222 /*
223  * Win32 also doesn't have symlinks, but we can emulate them with
224  * junction points on newer Win32 versions.
225  *
226  * Cygwin has its own symlinks which work on Win95/98/ME where
227  * junction points don't, so use those instead. We have no way of
228  * knowing what type of system Cygwin binaries will be run on.
229  * Note: Some CYGWIN includes might #define WIN32.
230  */
231 extern int pgsymlink(const char *oldpath, const char *newpath);
232 extern int pgreadlink(const char *path, char *buf, size_t size);
233 extern bool pgwin32_is_junction(const char *path);
234 
235 #define symlink(oldpath, newpath) pgsymlink(oldpath, newpath)
236 #define readlink(path, buf, size) pgreadlink(path, buf, size)
237 
238 /*
239  * Supplement to <sys/types.h>.
240  *
241  * Perl already has typedefs for uid_t and gid_t.
242  */
243 #ifndef PLPERL_HAVE_UID_GID
244 typedef int uid_t;
245 typedef int gid_t;
246 #endif
247 typedef long key_t;
248 
249 #ifdef _MSC_VER
250 typedef int pid_t;
251 #endif
252 
253 /*
254  * Supplement to <sys/stat.h>.
255  *
256  * We must pull in sys/stat.h before this part, else our overrides lose.
257  *
258  * stat() is not guaranteed to set the st_size field on win32, so we
259  * redefine it to our own implementation. See src/port/win32stat.c.
260  *
261  * The struct stat is 32 bit in MSVC, so we redefine it as a copy of
262  * struct __stat64. This also fixes the struct size for MINGW builds.
263  */
264 struct stat /* This should match struct __stat64 */
265 {
266  _dev_t st_dev;
267  _ino_t st_ino;
268  unsigned short st_mode;
269  short st_nlink;
270  short st_uid;
271  short st_gid;
272  _dev_t st_rdev;
273  __int64 st_size;
274  __time64_t st_atime;
275  __time64_t st_mtime;
276  __time64_t st_ctime;
277 };
278 
279 extern int _pgfstat64(int fileno, struct stat *buf);
280 extern int _pgstat64(const char *name, struct stat *buf);
281 
282 #define fstat(fileno, sb) _pgfstat64(fileno, sb)
283 #define stat(path, sb) _pgstat64(path, sb)
284 #define lstat(path, sb) _pgstat64(path, sb)
285 
286 /* These macros are not provided by older MinGW, nor by MSVC */
287 #ifndef S_IRUSR
288 #define S_IRUSR _S_IREAD
289 #endif
290 #ifndef S_IWUSR
291 #define S_IWUSR _S_IWRITE
292 #endif
293 #ifndef S_IXUSR
294 #define S_IXUSR _S_IEXEC
295 #endif
296 #ifndef S_IRWXU
297 #define S_IRWXU (S_IRUSR | S_IWUSR | S_IXUSR)
298 #endif
299 #ifndef S_IRGRP
300 #define S_IRGRP 0
301 #endif
302 #ifndef S_IWGRP
303 #define S_IWGRP 0
304 #endif
305 #ifndef S_IXGRP
306 #define S_IXGRP 0
307 #endif
308 #ifndef S_IRWXG
309 #define S_IRWXG 0
310 #endif
311 #ifndef S_IROTH
312 #define S_IROTH 0
313 #endif
314 #ifndef S_IWOTH
315 #define S_IWOTH 0
316 #endif
317 #ifndef S_IXOTH
318 #define S_IXOTH 0
319 #endif
320 #ifndef S_IRWXO
321 #define S_IRWXO 0
322 #endif
323 #ifndef S_ISDIR
324 #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
325 #endif
326 #ifndef S_ISREG
327 #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
328 #endif
329 
330 /*
331  * Supplement to <fcntl.h>.
332  * This is the same value as _O_NOINHERIT in the MS header file. This is
333  * to ensure that we don't collide with a future definition. It means
334  * we cannot use _O_NOINHERIT ourselves.
335  */
336 #define O_DSYNC 0x0080
337 
338 /*
339  * Supplement to <errno.h>.
340  *
341  * We redefine network-related Berkeley error symbols as the corresponding WSA
342  * constants. This allows strerror.c to recognize them as being in the Winsock
343  * error code range and pass them off to win32_socket_strerror(), since
344  * Windows' version of plain strerror() won't cope. Note that this will break
345  * if these names are used for anything else besides Windows Sockets errors.
346  * See TranslateSocketError() when changing this list.
347  */
348 #undef EAGAIN
349 #define EAGAIN WSAEWOULDBLOCK
350 #undef EINTR
351 #define EINTR WSAEINTR
352 #undef EMSGSIZE
353 #define EMSGSIZE WSAEMSGSIZE
354 #undef EAFNOSUPPORT
355 #define EAFNOSUPPORT WSAEAFNOSUPPORT
356 #undef EWOULDBLOCK
357 #define EWOULDBLOCK WSAEWOULDBLOCK
358 #undef ECONNABORTED
359 #define ECONNABORTED WSAECONNABORTED
360 #undef ECONNRESET
361 #define ECONNRESET WSAECONNRESET
362 #undef EINPROGRESS
363 #define EINPROGRESS WSAEINPROGRESS
364 #undef EISCONN
365 #define EISCONN WSAEISCONN
366 #undef ENOBUFS
367 #define ENOBUFS WSAENOBUFS
368 #undef EPROTONOSUPPORT
369 #define EPROTONOSUPPORT WSAEPROTONOSUPPORT
370 #undef ECONNREFUSED
371 #define ECONNREFUSED WSAECONNREFUSED
372 #undef ENOTSOCK
373 #define ENOTSOCK WSAENOTSOCK
374 #undef EOPNOTSUPP
375 #define EOPNOTSUPP WSAEOPNOTSUPP
376 #undef EADDRINUSE
377 #define EADDRINUSE WSAEADDRINUSE
378 #undef EADDRNOTAVAIL
379 #define EADDRNOTAVAIL WSAEADDRNOTAVAIL
380 #undef EHOSTDOWN
381 #define EHOSTDOWN WSAEHOSTDOWN
382 #undef EHOSTUNREACH
383 #define EHOSTUNREACH WSAEHOSTUNREACH
384 #undef ENETDOWN
385 #define ENETDOWN WSAENETDOWN
386 #undef ENETRESET
387 #define ENETRESET WSAENETRESET
388 #undef ENETUNREACH
389 #define ENETUNREACH WSAENETUNREACH
390 #undef ENOTCONN
391 #define ENOTCONN WSAENOTCONN
392 #undef ETIMEDOUT
393 #define ETIMEDOUT WSAETIMEDOUT
394 
395 /*
396  * Locale stuff.
397  *
398  * Extended locale functions with gratuitous underscore prefixes.
399  * (These APIs are nevertheless fully documented by Microsoft.)
400  */
401 #define locale_t _locale_t
402 #define tolower_l _tolower_l
403 #define toupper_l _toupper_l
404 #define towlower_l _towlower_l
405 #define towupper_l _towupper_l
406 #define isdigit_l _isdigit_l
407 #define iswdigit_l _iswdigit_l
408 #define isalpha_l _isalpha_l
409 #define iswalpha_l _iswalpha_l
410 #define isalnum_l _isalnum_l
411 #define iswalnum_l _iswalnum_l
412 #define isupper_l _isupper_l
413 #define iswupper_l _iswupper_l
414 #define islower_l _islower_l
415 #define iswlower_l _iswlower_l
416 #define isgraph_l _isgraph_l
417 #define iswgraph_l _iswgraph_l
418 #define isprint_l _isprint_l
419 #define iswprint_l _iswprint_l
420 #define ispunct_l _ispunct_l
421 #define iswpunct_l _iswpunct_l
422 #define isspace_l _isspace_l
423 #define iswspace_l _iswspace_l
424 #define strcoll_l _strcoll_l
425 #define strxfrm_l _strxfrm_l
426 #define wcscoll_l _wcscoll_l
427 #define wcstombs_l _wcstombs_l
428 #define mbstowcs_l _mbstowcs_l
429 
430 /*
431  * Versions of libintl >= 0.18? try to replace setlocale() with a macro
432  * to their own versions. Remove the macro, if it exists, because it
433  * ends up calling the wrong version when the backend and libintl use
434  * different versions of msvcrt.
435  */
436 #if defined(setlocale)
437 #undef setlocale
438 #endif
439 
440 /*
441  * Define our own wrapper macro around setlocale() to work around bugs in
442  * Windows' native setlocale() function.
443  */
444 extern char *pgwin32_setlocale(int category, const char *locale);
445 
446 #define setlocale(a,b) pgwin32_setlocale(a,b)
447 
448 
449 /* In backend/port/win32/signal.c */
450 extern PGDLLIMPORT volatile int pg_signal_queue;
451 extern PGDLLIMPORT int pg_signal_mask;
452 extern HANDLE pgwin32_signal_event;
453 extern HANDLE pgwin32_initial_signal_pipe;
454 
455 #define UNBLOCKED_SIGNAL_QUEUE() (pg_signal_queue & ~pg_signal_mask)
456 #define PG_SIGNAL_COUNT 32
457 
458 void pgwin32_signal_initialize(void);
459 HANDLE pgwin32_create_signal_listener(pid_t pid);
461 void pg_queue_signal(int signum);
462 
463 /* In src/port/kill.c */
464 #define kill(pid,sig) pgkill(pid,sig)
465 extern int pgkill(int pid, int sig);
466 
467 /* In backend/port/win32/socket.c */
468 #ifndef FRONTEND
469 #define socket(af, type, protocol) pgwin32_socket(af, type, protocol)
470 #define bind(s, addr, addrlen) pgwin32_bind(s, addr, addrlen)
471 #define listen(s, backlog) pgwin32_listen(s, backlog)
472 #define accept(s, addr, addrlen) pgwin32_accept(s, addr, addrlen)
473 #define connect(s, name, namelen) pgwin32_connect(s, name, namelen)
474 #define select(n, r, w, e, timeout) pgwin32_select(n, r, w, e, timeout)
475 #define recv(s, buf, len, flags) pgwin32_recv(s, buf, len, flags)
476 #define send(s, buf, len, flags) pgwin32_send(s, buf, len, flags)
477 
478 SOCKET pgwin32_socket(int af, int type, int protocol);
479 int pgwin32_bind(SOCKET s, struct sockaddr *addr, int addrlen);
480 int pgwin32_listen(SOCKET s, int backlog);
481 SOCKET pgwin32_accept(SOCKET s, struct sockaddr *addr, int *addrlen);
482 int pgwin32_connect(SOCKET s, const struct sockaddr *name, int namelen);
483 int pgwin32_select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, const struct timeval *timeout);
484 int pgwin32_recv(SOCKET s, char *buf, int len, int flags);
485 int pgwin32_send(SOCKET s, const void *buf, int len, int flags);
486 int pgwin32_waitforsinglesocket(SOCKET s, int what, int timeout);
487 
488 extern int pgwin32_noblock;
489 
490 #endif /* FRONTEND */
491 
492 /* in backend/port/win32_shmem.c */
493 extern int pgwin32_ReserveSharedMemoryRegion(HANDLE);
494 
495 /* in backend/port/win32/crashdump.c */
496 extern void pgwin32_install_crashdump_handler(void);
497 
498 /* in port/win32error.c */
499 extern void _dosmaperr(unsigned long);
500 
501 /* in port/win32env.c */
502 extern int pgwin32_putenv(const char *);
503 extern int pgwin32_setenv(const char *name, const char *value, int overwrite);
504 extern int pgwin32_unsetenv(const char *name);
505 
506 #define putenv(x) pgwin32_putenv(x)
507 #define setenv(x,y,z) pgwin32_setenv(x,y,z)
508 #define unsetenv(x) pgwin32_unsetenv(x)
509 
510 /* in port/win32security.c */
511 extern int pgwin32_is_service(void);
512 extern int pgwin32_is_admin(void);
513 
514 /* Windows security token manipulation (in src/common/exec.c) */
515 extern BOOL AddUserToTokenDacl(HANDLE hToken);
516 
517 /* Things that exist in MinGW headers, but need to be added to MSVC */
518 #ifdef _MSC_VER
519 
520 #ifndef _WIN64
521 typedef long ssize_t;
522 #else
523 typedef __int64 ssize_t;
524 #endif
525 
526 typedef unsigned short mode_t;
527 
528 #define F_OK 0
529 #define W_OK 2
530 #define R_OK 4
531 
532 /* Pulled from Makefile.port in MinGW */
533 #define DLSUFFIX ".dll"
534 
535 #endif /* _MSC_VER */
536 
537 #if (defined(_MSC_VER) && (_MSC_VER < 1900)) || \
538  defined(__MINGW32__) || defined(__MINGW64__)
539 /*
540  * VS2013 has a strtof() that seems to give correct answers for valid input,
541  * even on the rounding edge cases, but which doesn't handle out-of-range
542  * input correctly. Work around that.
543  *
544  * Mingw claims to have a strtof, and my reading of its source code suggests
545  * that it ought to work (and not need this hack), but the regression test
546  * results disagree with me; whether this is a version issue or not is not
547  * clear. However, using our wrapper (and the misrounded-input variant file,
548  * already required for supporting ancient systems) can't make things any
549  * worse, except for a tiny performance loss when reading zeros.
550  *
551  * See also cygwin.h for another instance of this.
552  */
553 #define HAVE_BUGGY_STRTOF 1
554 #endif
555 
556 #endif /* PG_WIN32_PORT_H */
int setitimer(int which, const struct itimerval *value, struct itimerval *ovalue)
Definition: timer.c:86
short st_nlink
Definition: win32_port.h:269
int pgwin32_setenv(const char *name, const char *value, int overwrite)
Definition: win32env.c:121
int tz_dsttime
Definition: win32_port.h:190
int pgwin32_noblock
Definition: socket.c:28
HANDLE pgwin32_signal_event
Definition: signal.c:27
int pgwin32_listen(SOCKET s, int backlog)
Definition: socket.c:325
int pgwin32_select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, const struct timeval *timeout)
Definition: socket.c:516
void pgwin32_install_crashdump_handler(void)
Definition: crashdump.c:180
void pgwin32_dispatch_queued_signals(void)
Definition: signal.c:108
HANDLE pgwin32_initial_signal_pipe
Definition: signal.c:28
int pgwin32_putenv(const char *)
Definition: win32env.c:27
int _pgstat64(const char *name, struct stat *buf)
void _dosmaperr(unsigned long)
Definition: win32error.c:171
void pg_queue_signal(int signum)
Definition: signal.c:215
SOCKET pgwin32_socket(int af, int type, int protocol)
Definition: socket.c:291
BOOL AddUserToTokenDacl(HANDLE hToken)
int pgwin32_unsetenv(const char *name)
Definition: win32env.c:150
_ino_t st_ino
Definition: win32_port.h:267
short st_uid
Definition: win32_port.h:270
#define PGDLLIMPORT
Definition: c.h:1317
int _pgfstat64(int fileno, struct stat *buf)
int pgwin32_ReserveSharedMemoryRegion(HANDLE)
Definition: win32_shmem.c:558
__time64_t st_ctime
Definition: win32_port.h:276
PGDLLIMPORT int pg_signal_mask
Definition: signal.c:25
int pgwin32_bind(SOCKET s, struct sockaddr *addr, int addrlen)
Definition: socket.c:314
short st_gid
Definition: win32_port.h:271
_dev_t st_dev
Definition: win32_port.h:266
static char * buf
Definition: pg_test_fsync.c:68
int pgkill(int pid, int sig)
__int64 st_size
Definition: win32_port.h:273
int pgwin32_is_service(void)
__time64_t st_atime
Definition: win32_port.h:274
int pgreadlink(const char *path, char *buf, size_t size)
int pgwin32_is_admin(void)
Definition: win32security.c:49
int pgwin32_waitforsinglesocket(SOCKET s, int what, int timeout)
Definition: socket.c:181
PGDLLIMPORT volatile int pg_signal_queue
Definition: signal.c:24
int pgwin32_send(SOCKET s, const void *buf, int len, int flags)
Definition: socket.c:458
int pgwin32_recv(SOCKET s, char *buf, int len, int flags)
Definition: socket.c:381
void pgwin32_signal_initialize(void)
Definition: signal.c:69
static void overwrite(PGconn *conn, Oid lobjId, int start, int len)
Definition: testlo.c:108
unsigned short st_mode
Definition: win32_port.h:268
char * pgwin32_setlocale(int category, const char *locale)
static int sig
Definition: pg_ctl.c:84
_dev_t st_rdev
Definition: win32_port.h:272
static struct @143 value
HANDLE pgwin32_create_signal_listener(pid_t pid)
Definition: signal.c:183
int pgwin32_connect(SOCKET s, const struct sockaddr *name, int namelen)
Definition: socket.c:358
long key_t
Definition: win32_port.h:247
int uid_t
Definition: win32_port.h:244
const char * name
Definition: encode.c:561
int gid_t
Definition: win32_port.h:245
static char * locale
Definition: initdb.c:126
__time64_t st_mtime
Definition: win32_port.h:275
SOCKET pgwin32_accept(SOCKET s, struct sockaddr *addr, int *addrlen)
Definition: socket.c:336
bool pgwin32_is_junction(const char *path)
int tz_minuteswest
Definition: win32_port.h:189
int pgsymlink(const char *oldpath, const char *newpath)