CS318 - Pintos
Pintos source browser for JHU CS318 course
|
Go to the documentation of this file.
6 #include "tests/vm/sample.inc"
13 char *actual[2] = {(
char *) 0x10000000, (
char *) 0x20000000};
17 for (
i = 0;
i < 2;
i++)
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);
#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 open(const char *file)
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.
mapid_t mmap(int fd, void *addr)
Project 3 and optionally project 4.