00001 /* Child process of mmap-exit. 00002 Mmaps a file and writes to it via the mmap'ing, then exits 00003 without calling munmap. The data in the mapped region must be 00004 written out at program termination. */ 00005 00006 #include <string.h> 00007 #include <syscall.h> 00008 #include "tests/vm/sample.inc" 00009 #include "tests/lib.h" 00010 #include "tests/main.h" 00011 00012 #define ACTUAL ((void *) 0x10000000) 00013 00014 void 00015 test_main (void) 00016 { 00017 int handle; 00018 00019 CHECK (create ("sample.txt", sizeof sample), "create \"sample.txt\""); 00020 CHECK ((handle = open ("sample.txt")) > 1, "open \"sample.txt\""); 00021 CHECK (mmap (handle, ACTUAL) != MAP_FAILED, "mmap \"sample.txt\""); 00022 memcpy (ACTUAL, sample, sizeof sample); 00023 } 00024