Lines Matching refs:tmpfile

222 	int			tmpfile;  in test_open()  local
227 if ((tmpfile = open(filename, O_RDWR | O_CREAT | PG_BINARY, S_IRUSR | S_IWUSR)) == -1) in test_open()
230 if (write(tmpfile, full_buf, DEFAULT_XLOG_SEG_SIZE) != in test_open()
235 if (fsync(tmpfile) != 0) in test_open()
238 close(tmpfile); in test_open()
244 int tmpfile, in test_sync() local
262 if ((tmpfile = open(filename, O_RDWR | O_DSYNC | PG_O_DIRECT | PG_BINARY, 0)) == -1) in test_sync()
273 if (write(tmpfile, buf, XLOG_BLCKSZ) != XLOG_BLCKSZ) in test_sync()
275 if (lseek(tmpfile, 0, SEEK_SET) == -1) in test_sync()
279 close(tmpfile); in test_sync()
292 if ((tmpfile = open(filename, O_RDWR | PG_BINARY, 0)) == -1) in test_sync()
298 if (write(tmpfile, buf, XLOG_BLCKSZ) != XLOG_BLCKSZ) in test_sync()
300 fdatasync(tmpfile); in test_sync()
301 if (lseek(tmpfile, 0, SEEK_SET) == -1) in test_sync()
305 close(tmpfile); in test_sync()
316 if ((tmpfile = open(filename, O_RDWR | PG_BINARY, 0)) == -1) in test_sync()
322 if (write(tmpfile, buf, XLOG_BLCKSZ) != XLOG_BLCKSZ) in test_sync()
324 if (fsync(tmpfile) != 0) in test_sync()
326 if (lseek(tmpfile, 0, SEEK_SET) == -1) in test_sync()
330 close(tmpfile); in test_sync()
339 if ((tmpfile = open(filename, O_RDWR | PG_BINARY, 0)) == -1) in test_sync()
345 if (write(tmpfile, buf, XLOG_BLCKSZ) != XLOG_BLCKSZ) in test_sync()
347 if (pg_fsync_writethrough(tmpfile) != 0) in test_sync()
349 if (lseek(tmpfile, 0, SEEK_SET) == -1) in test_sync()
353 close(tmpfile); in test_sync()
365 if ((tmpfile = open(filename, O_RDWR | OPEN_SYNC_FLAG | PG_O_DIRECT | PG_BINARY, 0)) == -1) in test_sync()
376 if (write(tmpfile, buf, XLOG_BLCKSZ) != XLOG_BLCKSZ) in test_sync()
385 if (lseek(tmpfile, 0, SEEK_SET) == -1) in test_sync()
389 close(tmpfile); in test_sync()
423 int tmpfile, in test_open_sync() local
432 if ((tmpfile = open(filename, O_RDWR | OPEN_SYNC_FLAG | PG_O_DIRECT | PG_BINARY, 0)) == -1) in test_open_sync()
440 if (write(tmpfile, buf, writes_size * 1024) != in test_open_sync()
443 if (lseek(tmpfile, 0, SEEK_SET) == -1) in test_open_sync()
447 close(tmpfile); in test_open_sync()
457 int tmpfile, in test_file_descriptor_sync() local
480 if ((tmpfile = open(filename, O_RDWR | PG_BINARY, 0)) == -1) in test_file_descriptor_sync()
482 if (write(tmpfile, buf, XLOG_BLCKSZ) != XLOG_BLCKSZ) in test_file_descriptor_sync()
484 if (fsync(tmpfile) != 0) in test_file_descriptor_sync()
486 close(tmpfile); in test_file_descriptor_sync()
492 if ((tmpfile = open(filename, O_RDWR | PG_BINARY, 0)) == -1) in test_file_descriptor_sync()
494 close(tmpfile); in test_file_descriptor_sync()
508 if ((tmpfile = open(filename, O_RDWR | PG_BINARY, 0)) == -1) in test_file_descriptor_sync()
510 if (write(tmpfile, buf, XLOG_BLCKSZ) != XLOG_BLCKSZ) in test_file_descriptor_sync()
512 close(tmpfile); in test_file_descriptor_sync()
514 if ((tmpfile = open(filename, O_RDWR | PG_BINARY, 0)) == -1) in test_file_descriptor_sync()
516 if (fsync(tmpfile) != 0) in test_file_descriptor_sync()
518 close(tmpfile); in test_file_descriptor_sync()
526 int tmpfile, in test_non_sync() local
539 if ((tmpfile = open(filename, O_RDWR | PG_BINARY, 0)) == -1) in test_non_sync()
541 if (write(tmpfile, buf, XLOG_BLCKSZ) != XLOG_BLCKSZ) in test_non_sync()
543 close(tmpfile); in test_non_sync()