MeiK2333 / MeiK2333.github.io

https://meik2333.com
3 stars 1 forks source link

关于 mmap 映射的内存的释放问题 | MeiK's blog #24

Open MeiK2333 opened 5 years ago

MeiK2333 commented 5 years ago

https://meik2333.com/2018/08/16/%E5%85%B3%E4%BA%8E-mmap-%E6%98%A0%E5%B0%84%E7%9A%84%E5%86%85%E5%AD%98%E7%9A%84%E9%87%8A%E6%94%BE%E9%97%AE%E9%A2%98/

123#include <sys/mman.h>void mmap(void addr, size_t len, int prot, int flag, int fd, off_t off);// 若执行成功, 则返回映射区的起始地址;若出错,则返回 MAP_FAILED