3 #include "tests/vm/sample.inc"
5 #include "tests/main.h"
10 char *actual = (char *) 0x54321000;
14 /* Open file, map, verify data. */
15 CHECK ((handle = open ("sample.txt")) > 1, "open \"sample.txt\"");
16 CHECK (mmap (handle, actual) != MAP_FAILED, "mmap \"sample.txt\"");
17 if (memcmp (actual, sample, strlen (sample)))
18 fail ("read of mmap'd file reported bad data");
20 /* Spawn child and wait. */
21 CHECK ((child = exec ("child-inherit")) != -1, "exec \"child-inherit\"");
23 CHECK (wait (child) == -1, "wait for child (should return -1)");
26 /* Verify data again. */
27 CHECK (!memcmp (actual, sample, strlen (sample)),
28 "checking that mmap'd file still has same data");