From 7d930e8abe28dfbb7946f704ff21afb4ef422107 Mon Sep 17 00:00:00 2001 From: Dave Jones Date: Fri, 6 Dec 2013 14:00:12 -0500 Subject: [PATCH] add per-child mmap list. --- child.c | 12 +++++++++--- include/shm.h | 3 +++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/child.c b/child.c index 9dd5494..72b18de 100644 --- a/child.c +++ b/child.c @@ -14,15 +14,18 @@ #include #include "child.h" -#include "syscall.h" +#include "list.h" #include "log.h" +#include "maps.h" +#include "params.h" // for 'debug' +#include "pids.h" #include "random.h" #include "shm.h" #include "signals.h" -#include "pids.h" -#include "params.h" // for 'debug' +#include "syscall.h" #include "tables.h" #include "trinity.h" // ARRAY_SIZE +#include "utils.h" // zmalloc static struct rlimit oldrlimit; @@ -115,6 +118,9 @@ void init_child(int childno) if (rand() % 100 < 50) use_fpu(); + + shm->mappings[childno] = zmalloc(sizeof(struct map)); + INIT_LIST_HEAD(&shm->mappings[childno]->list); } void check_parent_pid(void) diff --git a/include/shm.h b/include/shm.h index d83b39c..52c73f2 100644 --- a/include/shm.h +++ b/include/shm.h @@ -81,6 +81,9 @@ struct shm_s { int current_fd; unsigned int fd_lifetime; + /* per-child mmaps */ + struct map *mappings[MAX_NR_CHILDREN]; + /* various flags. */ bool do32bit[MAX_NR_CHILDREN]; bool do_make_it_fail; -- 2.11.4.GIT