More VM tests.
[pintos-anon] / grading / vm / child-mm-wrt.c
1 #define ACTUAL ((void *) 0x10000000)
2
3 int
4 main (void) 
5 {
6   int fd;
7
8   printf ("(mmap-write) begin\n");
9
10   /* Write file via mmap. */
11   if (!create ("sample.txt", strlen (sample)))
12     {
13       printf ("(mmap-write) create() failed\n");
14       return 1;
15     }
16   
17   fd = open ("sample.txt");
18   if (fd < 0) 
19     {
20       printf ("(mmap-write) open() failed\n");
21       return 1;
22     }
23
24   if (!mmap (fd, ACTUAL, strlen (sample)))
25     {
26       printf ("(mmap-write) mmap() failed\n");
27       return 1;
28     }
29   memcpy (ACTUAL, sample, strlen (sample));
30   return 234;
31 }
32