The discussion on -performance about disk caching reminded me that the useful fsync test utility does not seem to compile (git master on Ubuntu 10.04):

$ make
gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing -fwrapv -g -I../../../src/interfaces/libpq -I../../../src/include -D_GNU_SOURCE -c -o test_fsync.o test_fsync.c
In file included from /usr/include/fcntl.h:205,
from ../../../src/include/access/xlogdefs.h:15,
from ../../../src/include/access/xlog.h:15,
from ../../../src/include/access/xlog_internal.h:19,
from test_fsync.c:11:
In function ‘open’,
inlined from ‘main’ at test_fsync.c:66:
/usr/include/bits/fcntl2.h:45: error: call to ‘__open_too_many_args’ declared with attribute error: open can be called either with 2 or 3 arguments, not more
make: *** [test_fsync.o] Error 1

The tiny change (attached) seems it fix it for me.

regards

Mark
diff --git a/src/tools/fsync/test_fsync.c b/src/tools/fsync/test_fsync.c
index 3c9c6b6..28c2119 100644
--- a/src/tools/fsync/test_fsync.c
+++ b/src/tools/fsync/test_fsync.c
@@ -63,7 +63,7 @@ main(int argc, char *argv[])
 	for (i = 0; i < XLOG_SEG_SIZE; i++)
 		full_buf[i] = random();
 
-	if ((tmpfile = open(filename, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR, 0)) == -1)
+	if ((tmpfile = open(filename, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR)) == -1)
 		die("Cannot open output file.");
 	if (write(tmpfile, full_buf, XLOG_SEG_SIZE) != XLOG_SEG_SIZE)
 		die("write failed");
-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

Reply via email to