11 #define MEM_PATH "hello.bin"
12 #define MEM_SIZE 1048576
16 fd
= open(MEM_PATH
, O_RDWR
| O_SYNC
| O_CREAT
| O_CLOEXEC
, S_IRUSR
| S_IWUSR
);
17 ftruncate(fd
, MEM_SIZE
);
20 mem
= mmap(NULL
, MEM_SIZE
, PROT_READ
| PROT_WRITE
, MAP_SHARED
, fd
, 0);
23 char hello
[] = "Hello!";
24 memcpy(mem
, hello
, sizeof(hello
));
25 msync(mem
, sizeof(hello
), MS_SYNC
);
This page took 1.383925 seconds and 4 git commands to generate.