MCPcopy Create free account
hub / github.com/couchbase/forestdb / _disk_dump

Function _disk_dump

tests/functional/functional_util.cc:36–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34}
35
36int _disk_dump(const char *filepath, size_t pos, size_t bytes) {
37 struct filemgr_ops *ops = get_filemgr_ops();
38 int fd = ops->open(filepath, O_CREAT| O_RDWR, 0666);
39 if (fd < 0) {
40 fprintf(stderr, "failure to open %s\n", filepath);
41 return fd;
42 }
43 char *buf = (char *)malloc(bytes);
44 if (!buf) {
45 return -2;
46 }
47 if (ops->pwrite(fd, buf, bytes, pos) != (int) bytes) {
48 return -1;
49 }
50 ops->close(fd);
51 free(buf);
52 return fd;
53}
54
55void logCallbackFunc(int err_code,
56 const char *err_msg,

Callers 2

crash_recovery_testFunction · 0.85
tx_crash_recover_testFunction · 0.85

Calls 1

get_filemgr_opsFunction · 0.50

Tested by 2

crash_recovery_testFunction · 0.68
tx_crash_recover_testFunction · 0.68