Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit15ebfee

Browse files
committed
Add O_DIRECT support on Windows.
ITAGAKI Takahiro
1 parent85bbf01 commit15ebfee

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

‎src/include/port.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
9-
* $PostgreSQL: pgsql/src/include/port.h,v 1.110 2007/02/07 00:28:55 petere Exp $
9+
* $PostgreSQL: pgsql/src/include/port.h,v 1.111 2007/04/13 10:30:30 mha Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -277,6 +277,7 @@ extern bool rmtree(char *path, bool rmtopdir);
277277
/* open() and fopen() replacements to allow deletion of open files and
278278
* passing of other special options.
279279
*/
280+
#defineO_DIRECT0x80000000
280281
externintpgwin32_open(constchar*,int,...);
281282
externFILE*pgwin32_fopen(constchar*,constchar*);
282283

‎src/port/open.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
88
*
9-
* $PostgreSQL: pgsql/src/port/open.c,v 1.19 2007/02/1302:06:22 momjian Exp $
9+
* $PostgreSQL: pgsql/src/port/open.c,v 1.20 2007/04/1310:30:30 mha Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -53,7 +53,6 @@ openFlagsToCreateFileFlags(int openFlags)
5353

5454
/*
5555
* - file attribute setting, based on fileMode?
56-
* - handle other flags? (eg FILE_FLAG_NO_BUFFERING/FILE_FLAG_WRITE_THROUGH)
5756
*/
5857
int
5958
pgwin32_open(constchar*fileName,intfileFlags,...)
@@ -65,7 +64,7 @@ pgwin32_open(const char *fileName, int fileFlags,...)
6564
/* Check that we can handle the request */
6665
assert((fileFlags& ((O_RDONLY |O_WRONLY |O_RDWR) |O_APPEND |
6766
(O_RANDOM |O_SEQUENTIAL |O_TEMPORARY) |
68-
_O_SHORT_LIVED |O_DSYNC |
67+
_O_SHORT_LIVED |O_DSYNC |O_DIRECT |
6968
(O_CREAT |O_TRUNC |O_EXCL) | (O_TEXT |O_BINARY)))==fileFlags);
7069

7170
sa.nLength=sizeof(sa);
@@ -85,7 +84,8 @@ pgwin32_open(const char *fileName, int fileFlags,...)
8584
((fileFlags&O_SEQUENTIAL) ?FILE_FLAG_SEQUENTIAL_SCAN :0) |
8685
((fileFlags&_O_SHORT_LIVED) ?FILE_ATTRIBUTE_TEMPORARY :0) |
8786
((fileFlags&O_TEMPORARY) ?FILE_FLAG_DELETE_ON_CLOSE :0) |
88-
((fileFlags&O_DSYNC) ?FILE_FLAG_WRITE_THROUGH :0),
87+
((fileFlags&O_DIRECT) ?FILE_FLAG_NO_BUFFERING :0) |
88+
((fileFlags&O_DSYNC) ?FILE_FLAG_WRITE_THROUGH :0),
8989
NULL))==INVALID_HANDLE_VALUE)
9090
{
9191
switch (GetLastError())

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp