结合CSAPP两个习题说明mmap使用方法
从【man mmap】中可以看到该函数的定义。习题9.14:从文件中读取,然后写入。#include <iostream>#include <fcntl.h>#include <unistd.h>#include <sys/mman.h>using namespace std; int main(int argc, char* argv[]){ int fd = open(argv[1], O_RDWR); // s
原创
2021-07-05 21:49:25 ·
761 阅读 ·
0 评论