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
3455b0a5
Commit
3455b0a5
authored
Nov 23, 2006
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update fsync test to match new O_DIRECT behavior.
Greg Smith
parent
eb1fbbe5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
7 deletions
+21
-7
src/tools/fsync/test_fsync.c
src/tools/fsync/test_fsync.c
+21
-7
No files found.
src/tools/fsync/test_fsync.c
View file @
3455b0a5
...
...
@@ -14,6 +14,7 @@
#include <time.h>
#include <sys/time.h>
#include <unistd.h>
#include <string.h>
#ifdef WIN32
#define FSYNC_FILENAME "./test_fsync.out"
...
...
@@ -21,21 +22,34 @@
#define FSYNC_FILENAME "/var/tmp/test_fsync.out"
#endif
/* O_SYNC and O_FSYNC are the same */
/* This logic comes from src/backend/access/transam/xlog.c where it's
better documented */
#ifdef O_DIRECT
#define PG_O_DIRECT O_DIRECT
#else
#define PG_O_DIRECT 0
#endif
#if defined(O_SYNC)
#define
OPEN_SYNC_FLAG
O_SYNC
#define
BARE_OPEN_SYNC_FLAG
O_SYNC
#elif defined(O_FSYNC)
#define OPEN_SYNC_FLAG O_FSYNC
#elif defined(O_DSYNC)
#define OPEN_DATASYNC_FLAG O_DSYNC
#define BARE_OPEN_SYNC_FLAG O_FSYNC
#endif
#ifdef BARE_OPEN_SYNC_FLAG
#define OPEN_SYNC_FLAG (BARE_OPEN_SYNC_FLAG | PG_O_DIRECT)
#endif
#if defined(O_DSYNC)
#if defined(OPEN_SYNC_FLAG)
#if defined(O_DSYNC) && (O_DSYNC != OPEN_SYNC_FLAG)
#define OPEN_DATASYNC_FLAG O_DSYNC
#if O_DSYNC != BARE_OPEN_SYNC_FLAG
#define OPEN_DATASYNC_FLAG (O_DSYNC | PG_O_DIRECT)
#endif
#else
#define OPEN_DATASYNC_FLAG (O_DSYNC | PG_O_DIRECT)
#endif
#endif
#define WAL_FILE_SIZE (16 * 1024 * 1024)
void
die
(
char
*
str
);
...
...
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