mmap anonymous

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2019-08-11 00:00:02 +00:00
parent c03d5d18ea
commit b1767533af
8 changed files with 92 additions and 23 deletions

View File

@@ -1,13 +1,4 @@
/* https://cirosantilli.com/linux-kernel-module-cheat#mmap
*
* Example of mmap on files.
*
* Create a file, mmap to it, write to maped memory, close.
*
* Then read the file and confirm it was written to.
*
* Implemented in Linux by the mmap syscall.
*/
/* https://cirosantilli.com/linux-kernel-module-cheat#mmap-file */
#define _XOPEN_SOURCE 700
#include <assert.h>