[CRIU] [PATCH 41/44] parasite-syscall.c: introduced the macro MMAP_OFFSET.
Alexander Kartashov
alekskartashov at parallels.com
Mon Jan 7 10:05:10 EST 2013
The macro is designated to convert an offset into a page frame number
on architectures that support the syscall sys_mmap2 but don't support sys_mmap.
Signed-off-by: Alexander Kartashov <alekskartashov at parallels.com>
---
arch/x86/include/asm/parasite-syscall.h | 1 +
parasite-syscall.c | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/x86/include/asm/parasite-syscall.h b/arch/x86/include/asm/parasite-syscall.h
index 9eec2ee..2df2329 100644
--- a/arch/x86/include/asm/parasite-syscall.h
+++ b/arch/x86/include/asm/parasite-syscall.h
@@ -4,6 +4,7 @@
#define ARCH_SI_TRAP SI_KERNEL
+#define MMAP_OFFSET(offset) offset
extern const char code_syscall[];
extern const int code_syscall_size;
diff --git a/parasite-syscall.c b/parasite-syscall.c
index 6db9422..0ba5439 100644
--- a/parasite-syscall.c
+++ b/parasite-syscall.c
@@ -238,7 +238,7 @@ static void *mmap_seized(struct parasite_ctl *ctl,
int err;
err = syscall_seized(ctl, __NR_mmap, &map,
- (unsigned long)addr, length, prot, flags, fd, offset);
+ (unsigned long)addr, length, prot, flags, fd, MMAP_OFFSET(offset));
if (err < 0 || (long)map < 0)
map = 0;
--
1.7.10.4
More information about the CRIU
mailing list