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