From fb47385fc8d2314dd7d23d691959c882ead1c31a Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 8 Dec 2000 22:21:33 +0000 Subject: 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? --- src/backend/storage/file/fd.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/backend/storage/file/fd.c') 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: * @@ -192,6 +192,18 @@ static File fileNameOpenFile(FileName fileName, int fileFlags, int fileMode); 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 * -- cgit v1.2.3