69 pg_fatal(
"could not open file \"%s\": %m", src);
71 pg_fatal(
"could not close file \"%s\": %m", src);
115 pg_log_debug(
"would copy \"%s\" to \"%s\" using strategy %s",
124 pg_log_debug(
"copying \"%s\" to \"%s\" using strategy %s",
130 pg_log_debug(
"copying \"%s\" to \"%s\" and checksumming with %s",
145 const int buffer_size = 50 *
BLCKSZ;
153 pg_fatal(
"could not open file \"%s\": %m", src);
160 pg_fatal(
"could not update checksum of file \"%s\"", src);
164 pg_fatal(
"could not read file \"%s\": %m", src);
180 const int buffer_size = 50 *
BLCKSZ;
185 pg_fatal(
"could not open file \"%s\": %m", src);
200 pg_fatal(
"could not write to file \"%s\": %m",
dst);
202 pg_fatal(
"could not write to file \"%s\", offset %u: wrote %d of %d",
203 dst, offset, (
int)
wb, (
int)
rb);
207 pg_fatal(
"could not update checksum of file \"%s\"",
dst);
213 pg_fatal(
"could not read from file \"%s\": %m",
dst);
230#if defined(HAVE_COPYFILE) && defined(COPYFILE_CLONE_FORCE)
232 pg_fatal(
"error while cloning file \"%s\" to \"%s\": %m", src, dest);
233#elif defined(__linux__) && defined(FICLONE)
239 pg_fatal(
"could not open file \"%s\": %m", src);
243 pg_fatal(
"could not create file \"%s\": %m", dest);
251 pg_fatal(
"error while cloning file \"%s\" to \"%s\": %s",
259 pg_fatal(
"file cloning not supported on this platform");
276#if defined(HAVE_COPY_FILE_RANGE)
282 pg_fatal(
"could not open file \"%s\": %m", src);
286 pg_fatal(
"could not create file \"%s\": %m", dest);
292 pg_fatal(
"error while copying file range from \"%s\" to \"%s\": %m",
294 }
while (nbytes > 0);
299 pg_fatal(
"copy_file_range not supported on this platform");
314 pg_fatal(
"could not copy file \"%s\" to \"%s\": %m", src,
dst);
332 if (
link(src, dest) < 0)
333 pg_fatal(
"could not create link from \"%s\" to \"%s\": %m",
char * pg_checksum_type_name(pg_checksum_type type)
int pg_checksum_update(pg_checksum_context *context, const uint8 *input, size_t len)
static void copy_file_blocks(const char *src, const char *dst, pg_checksum_context *checksum_ctx)
static void copy_file_clone(const char *src, const char *dest, pg_checksum_context *checksum_ctx)
void copy_file(const char *src, const char *dst, pg_checksum_context *checksum_ctx, CopyMethod copy_method, bool dry_run)
static void checksum_file(const char *src, pg_checksum_context *checksum_ctx)
static void copy_file_link(const char *src, const char *dest, pg_checksum_context *checksum_ctx)
static void copy_file_by_range(const char *src, const char *dest, pg_checksum_context *checksum_ctx)
@ COPY_METHOD_COPY_FILE_RANGE
void * pg_malloc(size_t size)
#define pg_log_debug(...)
static int fd(const char *x, int i)
void _dosmaperr(unsigned long)