Lines Matching refs:tmpfile

223 	int			tmpfile;  in test_open()  local
228 if ((tmpfile = open(filename, O_RDWR | O_CREAT | PG_BINARY, S_IRUSR | S_IWUSR)) == -1) in test_open()
231 if (write(tmpfile, full_buf, DEFAULT_XLOG_SEG_SIZE) != in test_open()
236 if (fsync(tmpfile) != 0) in test_open()
239 close(tmpfile); in test_open()
245 int tmpfile, in test_sync() local
263 if ((tmpfile = open(filename, O_RDWR | O_DSYNC | PG_O_DIRECT | PG_BINARY, 0)) == -1) in test_sync()
274 if (write(tmpfile, buf, XLOG_BLCKSZ) != XLOG_BLCKSZ) in test_sync()
276 if (lseek(tmpfile, 0, SEEK_SET) == -1) in test_sync()
280 close(tmpfile); in test_sync()
293 if ((tmpfile = open(filename, O_RDWR | PG_BINARY, 0)) == -1) in test_sync()
299 if (write(tmpfile, buf, XLOG_BLCKSZ) != XLOG_BLCKSZ) in test_sync()
301 fdatasync(tmpfile); in test_sync()
302 if (lseek(tmpfile, 0, SEEK_SET) == -1) in test_sync()
306 close(tmpfile); in test_sync()
317 if ((tmpfile = open(filename, O_RDWR | PG_BINARY, 0)) == -1) in test_sync()
323 if (write(tmpfile, buf, XLOG_BLCKSZ) != XLOG_BLCKSZ) in test_sync()
325 if (fsync(tmpfile) != 0) in test_sync()
327 if (lseek(tmpfile, 0, SEEK_SET) == -1) in test_sync()
331 close(tmpfile); in test_sync()
340 if ((tmpfile = open(filename, O_RDWR | PG_BINARY, 0)) == -1) in test_sync()
346 if (write(tmpfile, buf, XLOG_BLCKSZ) != XLOG_BLCKSZ) in test_sync()
348 if (pg_fsync_writethrough(tmpfile) != 0) in test_sync()
350 if (lseek(tmpfile, 0, SEEK_SET) == -1) in test_sync()
354 close(tmpfile); in test_sync()
366 if ((tmpfile = open(filename, O_RDWR | OPEN_SYNC_FLAG | PG_O_DIRECT | PG_BINARY, 0)) == -1) in test_sync()
377 if (write(tmpfile, buf, XLOG_BLCKSZ) != XLOG_BLCKSZ) in test_sync()
386 if (lseek(tmpfile, 0, SEEK_SET) == -1) in test_sync()
390 close(tmpfile); in test_sync()
424 int tmpfile, in test_open_sync() local
433 if ((tmpfile = open(filename, O_RDWR | OPEN_SYNC_FLAG | PG_O_DIRECT | PG_BINARY, 0)) == -1) in test_open_sync()
441 if (write(tmpfile, buf, writes_size * 1024) != in test_open_sync()
444 if (lseek(tmpfile, 0, SEEK_SET) == -1) in test_open_sync()
448 close(tmpfile); in test_open_sync()
458 int tmpfile, in test_file_descriptor_sync() local
481 if ((tmpfile = open(filename, O_RDWR | PG_BINARY, 0)) == -1) in test_file_descriptor_sync()
483 if (write(tmpfile, buf, XLOG_BLCKSZ) != XLOG_BLCKSZ) in test_file_descriptor_sync()
485 if (fsync(tmpfile) != 0) in test_file_descriptor_sync()
487 close(tmpfile); in test_file_descriptor_sync()
493 if ((tmpfile = open(filename, O_RDWR | PG_BINARY, 0)) == -1) in test_file_descriptor_sync()
495 close(tmpfile); in test_file_descriptor_sync()
509 if ((tmpfile = open(filename, O_RDWR | PG_BINARY, 0)) == -1) in test_file_descriptor_sync()
511 if (write(tmpfile, buf, XLOG_BLCKSZ) != XLOG_BLCKSZ) in test_file_descriptor_sync()
513 close(tmpfile); in test_file_descriptor_sync()
515 if ((tmpfile = open(filename, O_RDWR | PG_BINARY, 0)) == -1) in test_file_descriptor_sync()
517 if (fsync(tmpfile) != 0) in test_file_descriptor_sync()
519 close(tmpfile); in test_file_descriptor_sync()
527 int tmpfile, in test_non_sync() local
540 if ((tmpfile = open(filename, O_RDWR | PG_BINARY, 0)) == -1) in test_non_sync()
542 if (write(tmpfile, buf, XLOG_BLCKSZ) != XLOG_BLCKSZ) in test_non_sync()
544 close(tmpfile); in test_non_sync()