diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2000-12-08 22:21:33 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2000-12-08 22:21:33 +0000 |
commit | fb47385fc8d2314dd7d23d691959c882ead1c31a (patch) | |
tree | ff678057f22ea18c88ac21f579cf1f0beb2194ad /src/backend/storage/file/fd.c | |
parent | 57c499a46313e1839674098079208b924dac3af9 (diff) | |
download | postgresql-fb47385fc8d2314dd7d23d691959c882ead1c31a.tar.gz postgresql-fb47385fc8d2314dd7d23d691959c882ead1c31a.zip |
Resurrect -F switch: it controls fsyncs again, though the fsyncs are
mostly just on the WAL logfile nowadays. But if people want to disable
fsync for performance, why should we say no?
Diffstat (limited to 'src/backend/storage/file/fd.c')
-rw-r--r-- | src/backend/storage/file/fd.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/backend/storage/file/fd.c b/src/backend/storage/file/fd.c index f46c04c4b6f..3cff7932129 100644 --- a/src/backend/storage/file/fd.c +++ b/src/backend/storage/file/fd.c @@ -7,7 +7,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/storage/file/fd.c,v 1.68 2000/11/30 08:46:23 vadim Exp $ + * $Header: /cvsroot/pgsql/src/backend/storage/file/fd.c,v 1.69 2000/12/08 22:21:32 tgl Exp $ * * NOTES: * @@ -193,6 +193,18 @@ static char *filepath(char *filename); static long pg_nofile(void); /* + * pg_fsync --- same as fsync except does nothing if -F switch was given + */ +int +pg_fsync(int fd) +{ + if (enableFsync) + return fsync(fd); + else + return 0; +} + +/* * BasicOpenFile --- same as open(2) except can free other FDs if needed * * This is exported for use by places that really want a plain kernel FD, |