blob: d109be81d60025f205a1d697acca7ec12ee725c9 [file] [log] [blame]
Ian Maxona70fba52016-02-18 13:52:36 -08001#include <stdio.h>
2#include <sys/mman.h>
3#include <unistd.h>
4#include <stdint.h>
5
6 int main() {
7
8 void *mem;
9 int err;
10 uint64_t size = 4.5 * 1024 * 1024;
11 size *= 1024;
12
13 mem = mmap(NULL, size, PROT_READ|PROT_WRITE, MAP_SHARED | MAP_ANONYMOUS, -1, 0);
14 printf ("%d\n", mem);
15 err = mlock(mem, size);
16 printf ("err is %d\n", err);
17 while(1) {
18 sleep(10000);
19 }
20 return 0;
21 }
22