X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=snapshot.cc;h=5069a1cf1147cb7afb07035cbf607c69daa2c284;hb=217296360283e2a11affe53bb1c94c84814bc9f6;hp=ba1c09034d6980bdfc1c841664c780668eee33b3;hpb=2b004336a919f74a5ca8f6d87ad5414360a949c7;p=cdsspec-compiler.git diff --git a/snapshot.cc b/snapshot.cc index ba1c090..5069a1c 100644 --- a/snapshot.cc +++ b/snapshot.cc @@ -13,8 +13,6 @@ #include "common.h" #include "context.h" -#define FAILURE(mesg) { model_print("failed in the API: %s with errno relative message: %s\n", mesg, strerror(errno)); exit(EXIT_FAILURE); } - /** PageAlignedAdressUpdate return a page aligned address for the * address being added as a side effect the numBytes are also changed. */ @@ -280,8 +278,10 @@ static void createSharedMemory() { //step 1. create shared memory. void *memMapBase = mmap(0, SHARED_MEMORY_DEFAULT + STACK_SIZE_DEFAULT, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_ANON, -1, 0); - if (MAP_FAILED == memMapBase) - FAILURE("mmap"); + if (memMapBase == MAP_FAILED) { + perror("mmap"); + exit(EXIT_FAILURE); + } //Setup snapshot record at top of free region fork_snap = (struct fork_snapshotter *)memMapBase;