13 char *data = (
char *) 0x7f000000;
16 CHECK (
create (
"empty", 0),
"create empty file \"empty\"");
17 CHECK ((handle =
open (
"empty")) > 1,
"open \"empty\"");
20 msg (
"mmap \"empty\"");
25 fail (
"unmapped memory is readable (%d)", *data);
mapid_t mmap(int fd, void *addr)
Project 3 and optionally project 4.
bool create(const char *file, unsigned initial_size)
int open(const char *file)
void fail(const char *format,...)
void msg(const char *format,...)
#define CHECK(SUCCESS,...)
Takes an expression to test for SUCCESS and a message, which may include printf-style arguments.
void test_main(void)
Tries to map a zero-length file, which may or may not work but should not terminate the process or cr...