MCPcopy Create free account
hub / github.com/apache/cloudberry / test_non_sync

Function test_non_sync

src/bin/pg_test_fsync/pg_test_fsync.c:549–572  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

547}
548
549static void
550test_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
574static void
575signal_cleanup(int signum)

Callers 1

mainFunction · 0.85

Calls 2

dieFunction · 0.85
pg_pwriteFunction · 0.85

Tested by

no test coverage detected