6#include "tests/vm/sample.inc"
13 char *actual[2] = {(
char *) 0x10000000, (
char *) 0x20000000};
17 for (i = 0; i < 2; i++)
19 CHECK ((handle[i] =
open (
"sample.txt")) > 1,
20 "open \"sample.txt\" #%zu", i);
22 "mmap \"sample.txt\" #%zu at %p", i, (
void *) actual[i]);
25 for (i = 0; i < 2; i++)
27 "compare mmap'd file %zu against data", i);
mapid_t mmap(int fd, void *addr)
Project 3 and optionally project 4.
int open(const char *file)
#define CHECK(SUCCESS,...)
Takes an expression to test for SUCCESS and a message, which may include printf-style arguments.
void test_main(void)
Maps the same file into memory twice and verifies that the same data is readable in both.
int memcmp(const void *a_, const void *b_, size_t size)
Find the first differing byte in the two blocks of SIZE bytes at A and B.
size_t strlen(const char *string)
Returns the length of STRING.