Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
5cfdd68f
Commit
5cfdd68f
authored
Dec 26, 2004
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rearrange include file contents into a saner order, add inclusion of
<signal.h>. Per Andrew Dunstan.
parent
e40ae565
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
49 deletions
+54
-49
src/include/port/win32.h
src/include/port/win32.h
+54
-49
No files found.
src/include/port/win32.h
View file @
5cfdd68f
/* $PostgreSQL: pgsql/src/include/port/win32.h,v 1.4
1 2004/12/01 23:42:26 momjian
Exp $ */
/* $PostgreSQL: pgsql/src/include/port/win32.h,v 1.4
2 2004/12/26 19:20:33 tgl
Exp $ */
/* undefine and redefine after #include */
#undef mkdir
...
...
@@ -7,6 +7,9 @@
#include <windows.h>
#include <winsock.h>
#include <process.h>
#include <signal.h>
#include <errno.h>
#undef near
/* Must be here to avoid conflicting with prototype in windows.h */
...
...
@@ -103,16 +106,15 @@ int semget(int semKey, int semNum, int flags);
int
semop
(
int
semId
,
struct
sembuf
*
sops
,
int
flag
);
/* In backend/port/win32/signal.c */
extern
DLLIMPORT
HANDLE
pgwin32_signal_event
;
extern
HANDLE
pgwin32_initial_signal_pipe
;
void
pgwin32_signal_initialize
(
void
);
HANDLE
pgwin32_create_signal_listener
(
pid_t
pid
);
void
pgwin32_dispatch_queued_signals
(
void
);
void
pg_queue_signal
(
int
signum
);
/*
* Signal stuff
*/
#define WEXITSTATUS(w) (((w) >> 8) & 0xff)
#define WIFEXITED(w) (((w) & 0xff) == 0)
#define WIFSIGNALED(w) (((w) & 0x7f) > 0 && (((w) & 0x7f) < 0x7f))
#define WTERMSIG(w) ((w) & 0x7f)
#define sigmask(sig) ( 1 << (
sig
-1) )
#define sigmask(sig) ( 1 << (
(sig)
-1) )
/* Signal function return values */
#undef SIG_DFL
...
...
@@ -122,44 +124,6 @@ void pg_queue_signal(int signum);
#define SIG_ERR ((pqsigfunc)-1)
#define SIG_IGN ((pqsigfunc)1)
#ifndef FRONTEND
#define pg_usleep(t) pgwin32_backend_usleep(t)
void
pgwin32_backend_usleep
(
long
microsec
);
#endif
/* In backend/port/win32/socket.c */
#ifndef FRONTEND
#define socket(af, type, protocol) pgwin32_socket(af, type, protocol)
#define accept(s, addr, addrlen) pgwin32_accept(s, addr, addrlen)
#define connect(s, name, namelen) pgwin32_connect(s, name, namelen)
#define select(n, r, w, e, timeout) pgwin32_select(n, r, w, e, timeout)
#define recv(s, buf, len, flags) pgwin32_recv(s, buf, len, flags)
#define send(s, buf, len, flags) pgwin32_send(s, buf, len, flags)
SOCKET
pgwin32_socket
(
int
af
,
int
type
,
int
protocol
);
SOCKET
pgwin32_accept
(
SOCKET
s
,
struct
sockaddr
*
addr
,
int
*
addrlen
);
int
pgwin32_connect
(
SOCKET
s
,
const
struct
sockaddr
*
name
,
int
namelen
);
int
pgwin32_select
(
int
nfds
,
fd_set
*
readfs
,
fd_set
*
writefds
,
fd_set
*
exceptfds
,
const
struct
timeval
*
timeout
);
int
pgwin32_recv
(
SOCKET
s
,
char
*
buf
,
int
len
,
int
flags
);
int
pgwin32_send
(
SOCKET
s
,
char
*
buf
,
int
len
,
int
flags
);
const
char
*
pgwin32_socket_strerror
(
int
err
);
int
pgwin32_waitforsinglesocket
(
SOCKET
s
,
int
what
);
/* in backend/port/win32/security.c */
extern
int
pgwin32_is_admin
(
void
);
extern
int
pgwin32_is_service
(
void
);
#endif
/* in backend/port/win32/error.c */
void
_dosmaperr
(
unsigned
long
);
#define WEXITSTATUS(w) (((w) >> 8) & 0xff)
#define WIFEXITED(w) (((w) & 0xff) == 0)
#define WIFSIGNALED(w) (((w) & 0x7f) > 0 && (((w) & 0x7f) < 0x7f))
#define WTERMSIG(w) ((w) & 0x7f)
/* Some extra signals */
#define SIGHUP 1
#define SIGQUIT 3
...
...
@@ -222,7 +186,6 @@ typedef int pid_t;
/*
* Supplement to <errno.h>.
*/
#include <errno.h>
#undef EAGAIN
#undef EINTR
#define EINTR WSAEINTR
...
...
@@ -237,3 +200,45 @@ typedef int pid_t;
#define ECONNREFUSED WSAECONNREFUSED
#define EBADFD WSAENOTSOCK
#define EOPNOTSUPP WSAEOPNOTSUPP
/* In backend/port/win32/signal.c */
extern
DLLIMPORT
HANDLE
pgwin32_signal_event
;
extern
HANDLE
pgwin32_initial_signal_pipe
;
void
pgwin32_signal_initialize
(
void
);
HANDLE
pgwin32_create_signal_listener
(
pid_t
pid
);
void
pgwin32_dispatch_queued_signals
(
void
);
void
pg_queue_signal
(
int
signum
);
#ifndef FRONTEND
#define pg_usleep(t) pgwin32_backend_usleep(t)
void
pgwin32_backend_usleep
(
long
microsec
);
#endif
/* In backend/port/win32/socket.c */
#ifndef FRONTEND
#define socket(af, type, protocol) pgwin32_socket(af, type, protocol)
#define accept(s, addr, addrlen) pgwin32_accept(s, addr, addrlen)
#define connect(s, name, namelen) pgwin32_connect(s, name, namelen)
#define select(n, r, w, e, timeout) pgwin32_select(n, r, w, e, timeout)
#define recv(s, buf, len, flags) pgwin32_recv(s, buf, len, flags)
#define send(s, buf, len, flags) pgwin32_send(s, buf, len, flags)
SOCKET
pgwin32_socket
(
int
af
,
int
type
,
int
protocol
);
SOCKET
pgwin32_accept
(
SOCKET
s
,
struct
sockaddr
*
addr
,
int
*
addrlen
);
int
pgwin32_connect
(
SOCKET
s
,
const
struct
sockaddr
*
name
,
int
namelen
);
int
pgwin32_select
(
int
nfds
,
fd_set
*
readfs
,
fd_set
*
writefds
,
fd_set
*
exceptfds
,
const
struct
timeval
*
timeout
);
int
pgwin32_recv
(
SOCKET
s
,
char
*
buf
,
int
len
,
int
flags
);
int
pgwin32_send
(
SOCKET
s
,
char
*
buf
,
int
len
,
int
flags
);
const
char
*
pgwin32_socket_strerror
(
int
err
);
int
pgwin32_waitforsinglesocket
(
SOCKET
s
,
int
what
);
/* in backend/port/win32/security.c */
extern
int
pgwin32_is_admin
(
void
);
extern
int
pgwin32_is_service
(
void
);
#endif
/* in backend/port/win32/error.c */
extern
void
_dosmaperr
(
unsigned
long
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment