| 547 | } |
| 548 | |
| 549 | static void |
| 550 | test_non_sync(void) |
| 551 | { |
| 552 | int tmpfile, |
| 553 | ops; |
| 554 | |
| 555 | /* |
| 556 | * Test a simple write without fsync |
| 557 | */ |
| 558 | printf(_("\nNon-sync'ed %dkB writes:\n"), XLOG_BLCKSZ_K); |
| 559 | printf(LABEL_FORMAT, "write"); |
| 560 | fflush(stdout); |
| 561 | |
| 562 | if ((tmpfile = open(filename, O_RDWR | PG_BINARY, 0)) == -1) |
| 563 | die("could not open output file"); |
| 564 | START_TIMER; |
| 565 | for (ops = 0; alarm_triggered == false; ops++) |
| 566 | { |
| 567 | if (pg_pwrite(tmpfile, buf, XLOG_BLCKSZ, 0) != XLOG_BLCKSZ) |
| 568 | die("write failed"); |
| 569 | } |
| 570 | STOP_TIMER; |
| 571 | close(tmpfile); |
| 572 | } |
| 573 | |
| 574 | static void |
| 575 | signal_cleanup(int signum) |