summaryrefslogtreecommitdiffstats
path: root/pintos-progos/tests/vm/mmap-null.c
diff options
context:
space:
mode:
Diffstat (limited to 'pintos-progos/tests/vm/mmap-null.c')
-rw-r--r--pintos-progos/tests/vm/mmap-null.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/pintos-progos/tests/vm/mmap-null.c b/pintos-progos/tests/vm/mmap-null.c
new file mode 100644
index 0000000..f8ef075
--- /dev/null
+++ b/pintos-progos/tests/vm/mmap-null.c
@@ -0,0 +1,15 @@
1/* Verifies that memory mappings at address 0 are disallowed. */
2
3#include <syscall.h>
4#include "tests/lib.h"
5#include "tests/main.h"
6
7void
8test_main (void)
9{
10 int handle;
11
12 CHECK ((handle = open ("sample.txt")) > 1, "open \"sample.txt\"");
13 CHECK (mmap (handle, NULL) == MAP_FAILED, "try to mmap at address 0");
14}
15