Added more userprog tests, mostly relating to boundary conditions
[pintos-anon] / src / tests / userprog / exec-bound-3.c
1 /* Invokes an exec system call with the exec string straddling a
2    page boundary such that the first byte of the string is valid
3    but the remainder of the string is in invalid memory. Must
4    kill process. */
5
6 #include <syscall-nr.h>
7 #include "tests/userprog/boundary.h"
8 #include "tests/lib.h"
9 #include "tests/main.h"
10
11 void
12 test_main (void) 
13 {
14   char *p = get_bad_boundary () - 1;
15   *p = 'a';
16   exec(p);
17   fail ("should have killed process");
18 }