X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=grading%2Fvm%2Fmmap-shuffle.c;h=15a37f438f26feb8ad5a047ef5f81a972624fb87;hb=44af3779a9c075ae30cdf7acc728bd47401f9b38;hp=273bb4e14606ddd6332e5aaadfe9fe1ad367f776;hpb=e23c0d5dc156a42b3f5169cbac692cfc4fb6394d;p=pintos-anon diff --git a/grading/vm/mmap-shuffle.c b/grading/vm/mmap-shuffle.c index 273bb4e..15a37f4 100644 --- a/grading/vm/mmap-shuffle.c +++ b/grading/vm/mmap-shuffle.c @@ -5,10 +5,14 @@ #else #include "posix-compat.h" #endif -#include "arc4.h" -#include "cksum.h" +#include "../lib/arc4.h" +#include "../lib/cksum.h" + +/* This is the max file size for an older version of the Pintos + file system that had 126 direct blocks each pointing to a + single disk sector. We could raise it now. */ +#define SIZE (126 * 512) -#define SIZE (63 * 1024) /* Max file size. */ static char *buf = (char *) 0x10000000; static struct arc4 * @@ -68,7 +72,7 @@ main (void) return 1; } - if (!mmap (fd, buf, SIZE)) + if (mmap (fd, buf) == MAP_FAILED) { printf ("(mmap-shuffle) mmap() failed\n"); return 1; @@ -83,7 +87,7 @@ main (void) for (i = 0; i < 10; i++) { shuffle (); - printf ("(mmap-shuffle) shuffle %d: cksum=%lu\n", + printf ("(mmap-shuffle) shuffle %zu: cksum=%lu\n", i, cksum (buf, SIZE)); }