memzap

replay memory writes
git clone git://git.2f30.org/memzap.git
Log | Files | Refs | README | LICENSE

commit 07ced4cd58e0932a464cb54c467928b51c52b9dc
parent e654163a70de4946608ce436cb170e3549bdcfd5
Author: sin <sin@2f30.org>
Date:   Sun Mar  3 00:52:18 +0000

Add mdiff_start_diff()

Diffstat:
mdiff.c | 14++++++++++++++
proto.h | 1+
2 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/mdiff.c b/mdiff.c @@ -73,6 +73,20 @@ mdiff_insert_hdr(int fd, struct mdiff_hdr *hdr) } int +mdiff_start_diff(int fd) +{ + int ret; + + if (fd < 0) + return -EINVAL; + + ret = lseek(fd, sizeof(struct mdiff_hdr), SEEK_SET); + if (ret < 0) + err(1, "lseek"); + return 0; +} + +int mdiff_append_rdiff(int fd, struct mem_region_diff *rdiff) { struct mem_diff *md; diff --git a/proto.h b/proto.h @@ -161,6 +161,7 @@ int create_mdiff(const char *path); int close_mdiff(int fd); int parse_mdiff_hdr(int fd); int mdiff_insert_hdr(int fd, struct mdiff_hdr *hdr); +int mdiff_start_diff(int fd); int mdiff_append_rdiff(int fd, struct mem_region_diff *rdiff); #endif