summaryrefslogtreecommitdiff
path: root/src/bin/pg_rewind/file_ops.h
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2015-03-23 19:47:52 +0200
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2015-03-23 19:47:52 +0200
commit61081e75c6741024f7717ade0450090590e96c85 (patch)
tree9b4fde1d8bae566036df68eecdfd84b896e14b57 /src/bin/pg_rewind/file_ops.h
parent87cec51d3ad1107f6f224ed7d773e70c8896e4c0 (diff)
Add pg_rewind, for re-synchronizing a master server after failback.
Earlier versions of this tool were available (and still are) on github. Thanks to Michael Paquier, Alvaro Herrera, Peter Eisentraut, Amit Kapila, and Satoshi Nagayasu for review.
Diffstat (limited to 'src/bin/pg_rewind/file_ops.h')
-rw-r--r--src/bin/pg_rewind/file_ops.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/bin/pg_rewind/file_ops.h b/src/bin/pg_rewind/file_ops.h
new file mode 100644
index 00000000000..f68c71df4ab
--- /dev/null
+++ b/src/bin/pg_rewind/file_ops.h
@@ -0,0 +1,24 @@
+/*-------------------------------------------------------------------------
+ *
+ * file_ops.h
+ * Helper functions for operating on files
+ *
+ * Copyright (c) 2013-2015, PostgreSQL Global Development Group
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef FILE_OPS_H
+#define FILE_OPS_H
+
+#include "filemap.h"
+
+extern void open_target_file(const char *path, bool trunc);
+extern void write_target_range(char *buf, off_t begin, size_t size);
+extern void close_target_file(void);
+extern void truncate_target_file(const char *path, off_t newsize);
+extern void create_target(file_entry_t *t);
+extern void remove_target(file_entry_t *t);
+
+extern char *slurpFile(const char *datadir, const char *path, size_t *filesize);
+
+#endif /* FILE_OPS_H */