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
afbc30e5
Commit
afbc30e5
authored
Feb 27, 2005
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow Win32 to support the O_SYNC open flag as an wal_sync_method method.
Magnus Hagander
parent
234d5081
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
6 deletions
+17
-6
src/include/port.h
src/include/port.h
+3
-2
src/include/port/win32.h
src/include/port/win32.h
+9
-1
src/port/open.c
src/port/open.c
+5
-3
No files found.
src/include/port.h
View file @
afbc30e5
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* $PostgreSQL: pgsql/src/include/port.h,v 1.
69 2005/01/06 00:59:25 tgl
Exp $
* $PostgreSQL: pgsql/src/include/port.h,v 1.
70 2005/02/27 00:53:29 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -174,7 +174,8 @@ extern bool rmtree(char *path, bool rmtopdir);
...
@@ -174,7 +174,8 @@ extern bool rmtree(char *path, bool rmtopdir);
#if defined(WIN32) && !defined(__CYGWIN__)
#if defined(WIN32) && !defined(__CYGWIN__)
/* open() replacement to allow delete of held files */
/* open() replacement to allow delete of held files and passing
* of special options. */
#ifndef WIN32_CLIENT_ONLY
#ifndef WIN32_CLIENT_ONLY
extern
int
win32_open
(
const
char
*
,
int
,...);
extern
int
win32_open
(
const
char
*
,
int
,...);
...
...
src/include/port/win32.h
View file @
afbc30e5
/* $PostgreSQL: pgsql/src/include/port/win32.h,v 1.4
2 2004/12/26 19:20:33 tgl
Exp $ */
/* $PostgreSQL: pgsql/src/include/port/win32.h,v 1.4
3 2005/02/27 00:53:29 momjian
Exp $ */
/* undefine and redefine after #include */
/* undefine and redefine after #include */
#undef mkdir
#undef mkdir
...
@@ -183,6 +183,14 @@ typedef int pid_t;
...
@@ -183,6 +183,14 @@ typedef int pid_t;
*/
*/
#define lstat(path, sb) stat((path), (sb))
#define lstat(path, sb) stat((path), (sb))
/*
* Supplement to <fcntl.h>.
* This is the same value as _O_NOINHERIT in the MS header file. This is
* to ensure that we don't collide with a future definition. It means
* we cannot use _O_NOINHERIT ourselves.
*/
#define O_SYNC 0x0080
/*
/*
* Supplement to <errno.h>.
* Supplement to <errno.h>.
*/
*/
...
...
src/port/open.c
View file @
afbc30e5
...
@@ -6,13 +6,14 @@
...
@@ -6,13 +6,14 @@
*
*
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
*
*
* $PostgreSQL: pgsql/src/port/open.c,v 1.
7 2004/12/31 22:03:53 pgsql
Exp $
* $PostgreSQL: pgsql/src/port/open.c,v 1.
8 2005/02/27 00:53:29 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
#ifdef WIN32
#ifdef WIN32
#include <postgres.h>
#include <windows.h>
#include <windows.h>
#include <fcntl.h>
#include <fcntl.h>
#include <errno.h>
#include <errno.h>
...
@@ -62,7 +63,7 @@ win32_open(const char *fileName, int fileFlags,...)
...
@@ -62,7 +63,7 @@ win32_open(const char *fileName, int fileFlags,...)
/* Check that we can handle the request */
/* Check that we can handle the request */
assert
((
fileFlags
&
((
O_RDONLY
|
O_WRONLY
|
O_RDWR
)
|
O_APPEND
|
assert
((
fileFlags
&
((
O_RDONLY
|
O_WRONLY
|
O_RDWR
)
|
O_APPEND
|
(
O_RANDOM
|
O_SEQUENTIAL
|
O_TEMPORARY
)
|
(
O_RANDOM
|
O_SEQUENTIAL
|
O_TEMPORARY
)
|
_O_SHORT_LIVED
|
_O_SHORT_LIVED
|
O_SYNC
|
(
O_CREAT
|
O_TRUNC
|
O_EXCL
)
|
(
O_TEXT
|
O_BINARY
)))
==
fileFlags
);
(
O_CREAT
|
O_TRUNC
|
O_EXCL
)
|
(
O_TEXT
|
O_BINARY
)))
==
fileFlags
);
sa
.
nLength
=
sizeof
(
sa
);
sa
.
nLength
=
sizeof
(
sa
);
...
@@ -81,7 +82,8 @@ win32_open(const char *fileName, int fileFlags,...)
...
@@ -81,7 +82,8 @@ win32_open(const char *fileName, int fileFlags,...)
((
fileFlags
&
O_RANDOM
)
?
FILE_FLAG_RANDOM_ACCESS
:
0
)
|
((
fileFlags
&
O_RANDOM
)
?
FILE_FLAG_RANDOM_ACCESS
:
0
)
|
((
fileFlags
&
O_SEQUENTIAL
)
?
FILE_FLAG_SEQUENTIAL_SCAN
:
0
)
|
((
fileFlags
&
O_SEQUENTIAL
)
?
FILE_FLAG_SEQUENTIAL_SCAN
:
0
)
|
((
fileFlags
&
_O_SHORT_LIVED
)
?
FILE_ATTRIBUTE_TEMPORARY
:
0
)
|
((
fileFlags
&
_O_SHORT_LIVED
)
?
FILE_ATTRIBUTE_TEMPORARY
:
0
)
|
((
fileFlags
&
O_TEMPORARY
)
?
FILE_FLAG_DELETE_ON_CLOSE
:
0
),
((
fileFlags
&
O_TEMPORARY
)
?
FILE_FLAG_DELETE_ON_CLOSE
:
0
)
|
((
fileFlags
&
O_SYNC
)
?
FILE_FLAG_WRITE_THROUGH
:
0
),
NULL
))
==
INVALID_HANDLE_VALUE
)
NULL
))
==
INVALID_HANDLE_VALUE
)
{
{
switch
(
GetLastError
())
switch
(
GetLastError
())
...
...
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