projects
/
pintos-anon
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
0f18a2ffd8c5faaa2855edde0fe7876dd9081608
[pintos-anon]
/
mmap-over-data.c
1
#include <stdint.h>
2
#include <round.h>
3
#include <syscall.h>
4
#include "tests/lib.h"
5
#include "tests/main.h"
6
7
static char x;
8
9
void
10
test_main (void)
11
{
12
uintptr_t x_page = ROUND_DOWN ((uintptr_t) &x, 4096);
13
int handle;
14
15
CHECK ((handle = open ("sample.txt")) > 1, "open \"sample.txt\"");
16
CHECK (mmap (handle, (void *) x_page) == MAP_FAILED,
17
"try to mmap over data segment");
18
}
19