*/
 #define FSYNC_FILENAME "./pg_test_fsync.out"
 
-#define WRITE_SIZE (8 * 1024)  /* 8k */
+#if XLOG_BLCKSZ != 8 * 1024  /* 8k */
+#error Unknown block size for test.
+#endif
 
 #define LABEL_FORMAT       "        %-32s"
 #define NA_FORMAT          LABEL_FORMAT "%18s"
    for (ops = 0; ops < ops_per_test; ops++)
    {
        for (writes = 0; writes < writes_per_op; writes++)
-           if (write(tmpfile, buf, WRITE_SIZE) != WRITE_SIZE)
+           if (write(tmpfile, buf, XLOG_BLCKSZ) != XLOG_BLCKSZ)
                die("write failed");
        if (lseek(tmpfile, 0, SEEK_SET) == -1)
            die("seek failed");
        for (ops = 0; ops < ops_per_test; ops++)
        {
            for (writes = 0; writes < writes_per_op; writes++)
-               if (write(tmpfile, buf, WRITE_SIZE) != WRITE_SIZE)
+               if (write(tmpfile, buf, XLOG_BLCKSZ) != XLOG_BLCKSZ)
                    die("write failed");
            if (lseek(tmpfile, 0, SEEK_SET) == -1)
                die("seek failed");
    for (ops = 0; ops < ops_per_test; ops++)
    {
        for (writes = 0; writes < writes_per_op; writes++)
-           if (write(tmpfile, buf, WRITE_SIZE) != WRITE_SIZE)
+           if (write(tmpfile, buf, XLOG_BLCKSZ) != XLOG_BLCKSZ)
                die("write failed");
        fdatasync(tmpfile);
        if (lseek(tmpfile, 0, SEEK_SET) == -1)
    for (ops = 0; ops < ops_per_test; ops++)
    {
        for (writes = 0; writes < writes_per_op; writes++)
-           if (write(tmpfile, buf, WRITE_SIZE) != WRITE_SIZE)
+           if (write(tmpfile, buf, XLOG_BLCKSZ) != XLOG_BLCKSZ)
                die("write failed");
        if (fsync(tmpfile) != 0)
            die("fsync failed");
    for (ops = 0; ops < ops_per_test; ops++)
    {
        for (writes = 0; writes < writes_per_op; writes++)
-           if (write(tmpfile, buf, WRITE_SIZE) != WRITE_SIZE)
+           if (write(tmpfile, buf, XLOG_BLCKSZ) != XLOG_BLCKSZ)
                die("write failed");
        if (pg_fsync_writethrough(tmpfile) != 0)
            die("fsync failed");
    for (ops = 0; ops < ops_per_test; ops++)
    {
        for (writes = 0; writes < writes_per_op; writes++)
-           if (write(tmpfile, buf, WRITE_SIZE) != WRITE_SIZE)
+           if (write(tmpfile, buf, XLOG_BLCKSZ) != XLOG_BLCKSZ)
                die("write failed");
        if (lseek(tmpfile, 0, SEEK_SET) == -1)
            die("seek failed");
        for (ops = 0; ops < ops_per_test; ops++)
        {
            for (writes = 0; writes < writes_per_op; writes++)
-               if (write(tmpfile, buf, WRITE_SIZE) != WRITE_SIZE)
+               if (write(tmpfile, buf, XLOG_BLCKSZ) != XLOG_BLCKSZ)
                    die("write failed");
            if (lseek(tmpfile, 0, SEEK_SET) == -1)
                die("seek failed");
    {
        if ((tmpfile = open(filename, O_RDWR, 0)) == -1)
            die("could not open output file");
-       if (write(tmpfile, buf, WRITE_SIZE) != WRITE_SIZE)
+       if (write(tmpfile, buf, XLOG_BLCKSZ) != XLOG_BLCKSZ)
            die("write failed");
        if (fsync(tmpfile) != 0)
            die("fsync failed");
    {
        if ((tmpfile = open(filename, O_RDWR, 0)) == -1)
            die("could not open output file");
-       if (write(tmpfile, buf, WRITE_SIZE) != WRITE_SIZE)
+       if (write(tmpfile, buf, XLOG_BLCKSZ) != XLOG_BLCKSZ)
            die("write failed");
        close(tmpfile);
        /* reopen file */
    {
        if ((tmpfile = open(filename, O_RDWR, 0)) == -1)
            die("could not open output file");
-       if (write(tmpfile, buf, WRITE_SIZE) != WRITE_SIZE)
+       if (write(tmpfile, buf, XLOG_BLCKSZ) != XLOG_BLCKSZ)
            die("write failed");
        close(tmpfile);
    }