#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 *
return 1;
}
- if (!mmap (fd, buf, SIZE))
+ if (mmap (fd, buf) == MAP_FAILED)
{
printf ("(mmap-shuffle) mmap() failed\n");
return 1;
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));
}