共享内存映射之mmap()函数详解

    共享内存映射之mmap()函数详解

    本文转自:http://blog.csdn.net/chdhust/article/details/8159397

    共享内存映射之mmap()函数详解
       共享内存可以说是最有用的进程间通信方式,也是最快的IPC形式,因为进程可以直接读写内存,而不需要任何 数据的拷贝。对于像管道和消息队列等通信方式,则需要在内核和用户空间进行四次的数据拷贝,而共享内存则 只拷贝两次数据: 一次从输入文件到共享内存区,另一次从共享内存区到输出文件。实际上,进程之间在共享内 存时,并不总是读写少量数据后就解除映射,有新的通信时,再重新建立共享内存区域。而是保持共享区域,直 到通信完毕为止,这样,数据内容一直保存在共享内存中,并没有写回文件。共享内存中的内容往往是在解除映 射时才写回文件的。因此,采用共享内存的通信方式效率是非常高的。

    一. 传统文件访问

    UNIX访问文件的传统方法是用open打开它们, 如果有多个进程访问同一个文件, 则每一个进程在自己的地址空间都包含有该

    文件的副本,这不必要地浪费了存储空间. 下图说明了两个进程同时读一个文件的同一页的情形. 系统要将该页从磁盘读到高

    速缓冲区中, 每个进程再执行一个存储器内的复制操作将数据从高速缓冲区读到自己的地址空间.

    二. 共享存储映射

    现在考虑另一种处理方法: 进程A和进程B都将该页映射到自己的地址空间, 当进程A第一次访问该页中的数据时, 它生成一

    个缺页中断. 内核此时读入这一页到内存并更新页表使之指向它.以后, 当进程B访问同一页面而出现缺页中断时, 该页已经在

    内存, 内核只需要将进程B的页表登记项指向次页即可. 如下图所示: 

    三、mmap()及其相关系统调用

    mmap()系统调用使得进程之间通过映射同一个普通文件实现共享内存。普通文件被映射到进程地址空间后,进程可以向访

    问普通内存一样对文件进行访问,不必再调用read(),write()等操作。

     

    mmap()系统调用形式如下:

    void* mmap ( void * addr , size_t len , int prot , int flags , int fd , off_t offset ) 

    mmap的作用是映射文件描述符fd指定文件的 [off,off + len]区域至调用进程的[addr, addr + len]的内存区域, 如下图所示:

     

    参数fd为即将映射到进程空间的文件描述字,一般由open()返回,同时,fd可以指定为-1,此时须指定flags参数中的

    MAP_ANON,表明进行的是匿名映射(不涉及具体的文件名,避免了文件的创建及打开,很显然只能用于具有亲缘关系的

    进程间通信)。

    len是映射到调用进程地址空间的字节数,它从被映射文件开头offset个字节开始算起。

    prot 参数指定共享内存的访问权限。可取如下几个值的或:PROT_READ(可读) , PROT_WRITE (可写), PROT_EXEC (可执行), PROT_NONE(不可访问)。

    flags由以下几个常值指定:MAP_SHARED , MAP_PRIVATE , MAP_FIXED,其中,MAP_SHARED , MAP_PRIVATE必

    选其一,而MAP_FIXED则不推荐使用。

    offset参数一般设为0,表示从文件头开始映射。

    参数addr指定文件应被映射到进程空间的起始地址,一般被指定一个空指针,此时选择起始地址的任务留给内核来完成。函

    数的返回值为最后文件映射到进程空间的地址,进程可直接操作起始地址为该值的有效地址。

    四. mmap的两个例子
    范例中使用的测试文件 data.txt: 
    Xml代码  收藏代码
    1. aaaaaaaaa  
    2. bbbbbbbbb  
    3. ccccccccc  
    4. ddddddddd  
     
    1 通过共享映射的方式修改文件

    C代码  收藏代码
    1. #include <sys/mman.h>  
    2. #include <sys/stat.h>  
    3. #include <fcntl.h>  
    4. #include <stdio.h>  
    5. #include <stdlib.h>  
    6. #include <unistd.h>  
    7. #include <error.h>  
    8.   
    9. #define BUF_SIZE 100  
    10.   
    11. int main(int argc, char **argv)  
    12. {  
    13.     int fd, nread, i;  
    14.     struct stat sb;  
    15.     char *mapped, buf[BUF_SIZE];  
    16.   
    17.     for (i = 0; i < BUF_SIZE; i++) {  
    18.         buf[i] = '#';  
    19.     }  
    20.   
    21.     /* 打开文件 */  
    22.     if ((fd = open(argv[1], O_RDWR)) < 0) {  
    23.         perror("open");  
    24.     }  
    25.   
    26.     /* 获取文件的属性 */  
    27.     if ((fstat(fd, &sb)) == -1) {  
    28.         perror("fstat");  
    29.     }  
    30.   
    31.     /* 将文件映射至进程的地址空间 */  
    32.     if ((mapped = (char *)mmap(NULL, sb.st_size, PROT_READ |   
    33.                     PROT_WRITE, MAP_SHARED, fd, 0)) == (void *)-1) {  
    34.         perror("mmap");  
    35.     }  
    36.   
    37.     /* 映射完后, 关闭文件也可以操纵内存 */  
    38.     close(fd);  
    39.   
    40.     printf("%s", mapped);  
    41.   
    42.     /* 修改一个字符,同步到磁盘文件 */  
    43.     mapped[20] = '9';  
    44.     if ((msync((void *)mapped, sb.st_size, MS_SYNC)) == -1) {  
    45.         perror("msync");  
    46.     }  
    47.   
    48.     /* 释放存储映射区 */  
    49.     if ((munmap((void *)mapped, sb.st_size)) == -1) {  
    50.         perror("munmap");  
    51.     }  
    52.   
    53.     return 0;  
    54. }  
     
    2 私有映射无法修改文件

    /* 将文件映射至进程的地址空间 */
    if ((mapped = (char *)mmap(NULL, sb.st_size, PROT_READ | 
                        PROT_WRITE, MAP_PRIVATE, fd, 0)) == (void *)-1) {
        perror("mmap");
    }
    五. 使用共享映射实现两个进程之间的通信
    两个程序映射同一个文件到自己的地址空间, 进程A先运行, 每隔两秒读取映射区域, 看是否发生变化. 
    进程B后运行, 它修改映射区域, 然后推出, 此时进程A能够观察到存储映射区的变化
    进程A的代码:
    C代码  收藏代码
    1. #include <sys/mman.h>  
    2. #include <sys/stat.h>  
    3. #include <fcntl.h>  
    4. #include <stdio.h>  
    5. #include <stdlib.h>  
    6. #include <unistd.h>  
    7. #include <error.h>  
    8.   
    9. #define BUF_SIZE 100  
    10.   
    11. int main(int argc, char **argv)  
    12. {  
    13.     int fd, nread, i;  
    14.     struct stat sb;  
    15.     char *mapped, buf[BUF_SIZE];  
    16.   
    17.     for (i = 0; i < BUF_SIZE; i++) {  
    18.         buf[i] = '#';  
    19.     }  
    20.   
    21.     /* 打开文件 */  
    22.     if ((fd = open(argv[1], O_RDWR)) < 0) {  
    23.         perror("open");  
    24.     }  
    25.   
    26.     /* 获取文件的属性 */  
    27.     if ((fstat(fd, &sb)) == -1) {  
    28.         perror("fstat");  
    29.     }  
    30.   
    31.     /* 将文件映射至进程的地址空间 */  
    32.     if ((mapped = (char *)mmap(NULL, sb.st_size, PROT_READ |   
    33.                     PROT_WRITE, MAP_SHARED, fd, 0)) == (void *)-1) {  
    34.         perror("mmap");  
    35.     }  
    36.   
    37.     /* 文件已在内存, 关闭文件也可以操纵内存 */  
    38.     close(fd);  
    39.       
    40.     /* 每隔两秒查看存储映射区是否被修改 */  
    41.     while (1) {  
    42.         printf("%s\n", mapped);  
    43.         sleep(2);  
    44.     }  
    45.   
    46.     return 0;  
    47. }  
     
    进程B的代码:
    C代码  收藏代码
    1. #include <sys/mman.h>  
    2. #include <sys/stat.h>  
    3. #include <fcntl.h>  
    4. #include <stdio.h>  
    5. #include <stdlib.h>  
    6. #include <unistd.h>  
    7. #include <error.h>  
    8.   
    9. #define BUF_SIZE 100  
    10.   
    11. int main(int argc, char **argv)  
    12. {  
    13.     int fd, nread, i;  
    14.     struct stat sb;  
    15.     char *mapped, buf[BUF_SIZE];  
    16.   
    17.     for (i = 0; i < BUF_SIZE; i++) {  
    18.         buf[i] = '#';  
    19.     }  
    20.   
    21.     /* 打开文件 */  
    22.     if ((fd = open(argv[1], O_RDWR)) < 0) {  
    23.         perror("open");  
    24.     }  
    25.   
    26.     /* 获取文件的属性 */  
    27.     if ((fstat(fd, &sb)) == -1) {  
    28.         perror("fstat");  
    29.     }  
    30.   
    31.     /* 私有文件映射将无法修改文件 */  
    32.     if ((mapped = (char *)mmap(NULL, sb.st_size, PROT_READ |   
    33.                     PROT_WRITE, MAP_PRIVATE, fd, 0)) == (void *)-1) {  
    34.         perror("mmap");  
    35.     }  
    36.   
    37.     /* 映射完后, 关闭文件也可以操纵内存 */  
    38.     close(fd);  
    39.   
    40.     /* 修改一个字符 */  
    41.     mapped[20] = '9';  
    42.    
    43.     return 0;  
    44. }  
     
    六. 通过匿名映射实现父子进程通信
    C代码  收藏代码
    1. #include <sys/mman.h>  
    2. #include <stdio.h>  
    3. #include <stdlib.h>  
    4. #include <unistd.h>  
    5.   
    6. #define BUF_SIZE 100  
    7.   
    8. int main(int argc, char** argv)  
    9. {  
    10.     char    *p_map;  
    11.   
    12.     /* 匿名映射,创建一块内存供父子进程通信 */  
    13.     p_map = (char *)mmap(NULL, BUF_SIZE, PROT_READ | PROT_WRITE,  
    14.             MAP_SHARED | MAP_ANONYMOUS, -1, 0);  
    15.   
    16.     if(fork() == 0) {  
    17.         sleep(1);  
    18.         printf("child got a message: %s\n", p_map);  
    19.         sprintf(p_map, "%s""hi, dad, this is son");  
    20.         munmap(p_map, BUF_SIZE); //实际上,进程终止时,会自动解除映射。  
    21.         exit(0);  
    22.     }  
    23.   
    24.     sprintf(p_map, "%s""hi, this is father");  
    25.     sleep(2);  
    26.     printf("parent got a message: %s\n", p_map);  
    27.   
    28.     return 0;  
    29. }  
     
    七. 对mmap()返回地址的访问
    linux采用的是页式管理机制。对于用mmap()映射普通文件来说,进程会在自己的地址空间新增一块空间,空间大
    小由mmap()的len参数指定,注意,进程并不一定能够对全部新增空间都能进行有效访问。进程能够访问的有效地址大小取决于文件被映射部分的大小。简单的说,能够容纳文件被映射部分大小的最少页面个数决定了进程从mmap()返回的地址开始,能够有效访问的地址空间大小。超过这个空间大小,内核会根据超过的严重程度返回发送不同的信号给进程。可用如下图示说明:

     

    总结一下就是, 文件大小, mmap的参数 len 都不能决定进程能访问的大小, 而是容纳文件被映射部分的最小页面数决定

    进程能访问的大小. 下面看一个实例:

     

     

    C代码  收藏代码
    1. #include <sys/mman.h>  
    2. #include <sys/types.h>  
    3. #include <sys/stat.h>  
    4. #include <fcntl.h>  
    5. #include <unistd.h>  
    6. #include <stdio.h>  
    7.   
    8. int main(int argc, char** argv)  
    9. {  
    10.     int fd,i;  
    11.     int pagesize,offset;  
    12.     char *p_map;  
    13.     struct stat sb;  
    14.   
    15.     /* 取得page size */  
    16.     pagesize = sysconf(_SC_PAGESIZE);  
    17.     printf("pagesize is %d\n",pagesize);  
    18.   
    19.     /* 打开文件 */  
    20.     fd = open(argv[1], O_RDWR, 00777);  
    21.     fstat(fd, &sb);  
    22.     printf("file size is %zd\n", (size_t)sb.st_size);  
    23.   
    24.     offset = 0;   
    25.     p_map = (char *)mmap(NULL, pagesize * 2, PROT_READ|PROT_WRITE,   
    26.             MAP_SHARED, fd, offset);  
    27.     close(fd);  
    28.       
    29.     p_map[sb.st_size] = '9';  /* 导致总线错误 */  
    30.     p_map[pagesize] = '9';    /* 导致段错误 */  
    31.   
    32.     munmap(p_map, pagesize * 2);  
    33.   
    34.     return 0;  
    35. }  
    参考来源:

    http://wenku.baidu.com/view/e7d9b222bcd126fff7050b53.html

    http://learn.akae.cn/media/ch28s09.html

    http://blog.nosqlfan.com/html/2956.html


    })()

        <div class="t0 clearfix">
    													<div class="content">
    														<a href="https://blog.csdn.net/u013525455/article/details/52582839" target="_blank" title="<em>mmap</em><em>函数</em>使用与实例<em>详解</em>" data-track-view="{&quot;mod&quot;:&quot;popu_642&quot;,&quot;con&quot;: &quot;,https://blog.csdn.net/u013525455/article/details/52582839,&quot;}" data-track-click="{&quot;mod&quot;:&quot;popu_642&quot;,&quot;con&quot;: &quot;,https://blog.csdn.net/u013525455/article/details/52582839,&quot;}">
    														<h4 class="text-truncate oneline"><em>mmap</em><em>函数</em>使用与实例<em>详解</em></h4>
    														<div class="info-box d-flex align-content-center">
    															<p class="date-and-readNum">
    																<span class="date hover-show">09-19</span>
    																<span class="read-num hover-hide"><svg class="icon csdnc-yuedushu" aria-hidden="true"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#csdnc-m-passwords-visible"></use></svg>5724</span>
    															</p>
    															</div>
    														</a>
    															<p class="content">
    																<a href="https://blog.csdn.net/u013525455/article/details/52582839" target="_blank" title="<em>mmap</em><em>函数</em>使用与实例<em>详解</em>" data-track-click="{&quot;mod&quot;:&quot;popu_642&quot;,&quot;con&quot;: &quot;,https://blog.csdn.net/u013525455/article/details/52582839,&quot;}">
    																	<span class="desc oneline">mmap&nbsp;编辑mmap将一个文件或者其它对象映射进内存。文件被映射到多个页上,如果文件的大小不是所有页的大小之和,最后一个页不被使用的空间将会清零。mmap在用户空间映射调用系统中作用很大。头文件函数...</span>
    																</a>
    										            <span class="blog_title_box oneline"><a target="_blank" href="https://blog.csdn.net/u013525455">来自:	<span class="blog_title"> u013525455</span></a></span>
    										          </p>
    													</div>
    												</div>        <a id="commentBox"></a>
    
    <div class="comment-edit-box d-flex">
    	<a id="commentsedit"></a>
    	<div class="user-img">
    		<a href="//me.csdn.net/qq_33441035" target="_blank">
    			<img class="" src="https://avatar.csdn.net/F/6/C/3_qq_33441035.jpg">
    		</a>
    	</div>
    	<form id="commentform">
    		<input type="hidden" id="comment_replyId">
    		<textarea class="comment-content" name="comment_content" id="comment_content" placeholder="想对作者说点什么"></textarea>
    		<div class="opt-box"> <!-- d-flex -->
    			<div id="ubbtools" class="add_code">
    				<a href="#insertcode" code="code" target="_self"><i class="icon iconfont icon-daima"></i></a>
    			</div>
    			<input type="hidden" id="comment_replyId" name="comment_replyId">
    			<input type="hidden" id="article_id" name="article_id" value="39805565">
    			<input type="hidden" id="comment_userId" name="comment_userId" value="">
    			<input type="hidden" id="commentId" name="commentId" value="">
    			<div style="display: none;" class="csdn-tracking-statistics tracking-click" data-mod="popu_384"><a href="#" target="_blank" class="comment_area_btn">发表评论</a></div>
    			<div class="dropdown" id="myDrap">
    				<a class="dropdown-face d-flex align-items-center" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
    				<div class="txt-selected text-truncate">添加代码片</div>
    				<svg class="icon d-block" aria-hidden="true">
    					<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#csdnc-triangledown"></use>
    				</svg>
    				</a>
    				<ul class="dropdown-menu" id="commentCode" aria-labelledby="drop4">
    					<li><a data-code="html">HTML/XML</a></li>
    					<li><a data-code="objc">objective-c</a></li>
    					<li><a data-code="ruby">Ruby</a></li>
    					<li><a data-code="php">PHP</a></li>
    					<li><a data-code="csharp">C</a></li>
    					<li><a data-code="cpp">C++</a></li>
    					<li><a data-code="javascript">JavaScript</a></li>
    					<li><a data-code="python">Python</a></li>
    					<li><a data-code="java">Java</a></li>
    					<li><a data-code="css">CSS</a></li>
    					<li><a data-code="sql">SQL</a></li>
    					<li><a data-code="plain">其它</a></li>
    				</ul>
    			</div>  
    			<div class="right-box">
    				<span id="tip_comment" class="tip">还能输入<em>1000</em>个字符</span>
    				<input type="submit" class="btn btn-sm btn-red btn-comment" value="发表评论">
    			</div>
    		</div>
    	</form>
    </div>
    
    	<div class="comment-list-container">
    	<a id="comments"></a>
    	<div class="comment-list-box">
    	</div>
    	<div id="commentPage" class="pagination-box d-none"></div>
    	
    </div>
    
    		<div class="recommend-item-box recommend-box-ident type_blog clearfix" data-track-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/notbaron/article/details/80019134,BlogCommendFromThirdServiceAll_2&quot;}" data-track-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/notbaron/article/details/80019134,BlogCommendFromThirdServiceAll_2&quot;}" data-flg="true">
    		<div class="content" style="width: 712px;">
    			<a href="https://blog.csdn.net/notbaron/article/details/80019134" target="_blank" title="linux内存管理——mmap函数详解">
    			<h4 class="text-truncate oneline" style="width: 553px;">
    					linux内存管理——<em>mmap</em><em>函数</em><em>详解</em>				</h4>
    			<div class="info-box d-flex align-content-center">
    				<p class="date-and-readNum oneline">
    					<span class="date hover-show">04-20</span>
    					<span class="read-num hover-hide">
              阅读数 
    						896</span>
    					</p>
    				</div>
    			</a>
    				<p class="content" style="width: 712px;">
    					<a href="https://blog.csdn.net/notbaron/article/details/80019134" target="_blank" title="linux内存管理——mmap函数详解">
    						<span class="desc oneline">mmap函数是unix/linux下的系统调用。当存在客户-服务程序中复制文件时候,其数据流如下,要经历四次数据复制,开销很大。&nbsp;	如果采用共享内存的方式,那么将大大优化IO操作,数据流变成了如下,数...</span>
    					</a>
    					  <span class="blog_title_box oneline ">
    						                <span class="type-show type-show-blog type-show-after">博文</span>
                                  <a target="_blank" href="https://blog.csdn.net/notbaron">来自:	<span class="blog_title"> badman250的专栏</span></a>
                							              </span>
    				</p>
    		</div>
    				</div>
    
    
    
    		<div class="recommend-item-box recommend-box-ident type_blog clearfix" data-track-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/samxx8/article/details/73506198,BlogCommendFromThirdServiceAll_3&quot;}" data-track-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/samxx8/article/details/73506198,BlogCommendFromThirdServiceAll_3&quot;}" data-flg="true">
    		<div class="content" style="width: 712px;">
    			<a href="https://blog.csdn.net/samxx8/article/details/73506198" target="_blank" title="golang 结合cgo 操作共享内存,包括虚拟内存mmap版和内存shm版">
    			<h4 class="text-truncate oneline" style="width: 553px;">
    					golang 结合cgo 操作<em>共享</em>内存,包括虚拟内存<em>mmap</em>版和内存shm版				</h4>
    			<div class="info-box d-flex align-content-center">
    				<p class="date-and-readNum oneline">
    					<span class="date hover-show">06-20</span>
    					<span class="read-num hover-hide">
              阅读数 
    						2194</span>
    					</p>
    				</div>
    			</a>
    				<p class="content" style="width: 712px;">
    					<a href="https://blog.csdn.net/samxx8/article/details/73506198" target="_blank" title="golang 结合cgo 操作共享内存,包括虚拟内存mmap版和内存shm版">
    						<span class="desc oneline">golang结合C操作共享内存,包括虚拟内存mmap版和内存shm版</span>
    					</a>
    					  <span class="blog_title_box oneline ">
    						                <span class="type-show type-show-blog type-show-after">博文</span>
                                  <a target="_blank" href="https://blog.csdn.net/samxx8">来自:	<span class="blog_title"> 可克技术</span></a>
                							              </span>
    				</p>
    		</div>
    				</div>
    
    <div class="recommend-item-box recommend-ad-box"><div id="kp_box_59" data-pid="59" data-track-view="{&quot;mod&quot;:&quot;kp_popu_59-517&quot;,&quot;con&quot;:&quot;,,&quot;}" data-track-click="{&quot;mod&quot;:&quot;kp_popu_59-517&quot;,&quot;con&quot;:&quot;,,&quot;}"><div id="three_ad1" class="mediav_ad"></div>
    
    		<div class="recommend-item-box recommend-box-ident type_blog clearfix" data-track-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/earbao/article/details/76021818,BlogCommendFromThirdServiceAll_4&quot;}" data-track-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/earbao/article/details/76021818,BlogCommendFromThirdServiceAll_4&quot;}" data-flg="true">
    		<div class="content" style="width: 712px;">
    			<a href="https://blog.csdn.net/earbao/article/details/76021818" target="_blank" title="c语言实现mmap内存映射读取文件和文件加密">
    			<h4 class="text-truncate oneline" style="width: 553px;">
    					c语言实现<em>mmap</em><em>内存映射</em>读取文件和文件加密				</h4>
    			<div class="info-box d-flex align-content-center">
    				<p class="date-and-readNum oneline">
    					<span class="date hover-show">07-24</span>
    					<span class="read-num hover-hide">
              阅读数 
    						1859</span>
    					</p>
    				</div>
    			</a>
    				<p class="content" style="width: 712px;">
    					<a href="https://blog.csdn.net/earbao/article/details/76021818" target="_blank" title="c语言实现mmap内存映射读取文件和文件加密">
    						<span class="desc oneline">#define_CRT_SECURE_NO_WARNINGS1#include#include#include#include#include#defineLOGDprintf#if_WIN32#in...</span>
    					</a>
    					  <span class="blog_title_box oneline ">
    						                <span class="type-show type-show-blog type-show-after">博文</span>
                                  <a target="_blank" href="https://blog.csdn.net/earbao">来自:	<span class="blog_title"> 云守护的专栏</span></a>
                							              </span>
    				</p>
    		</div>
    				</div>
    
    
    
    		<div class="recommend-item-box recommend-box-ident type_blog clearfix" data-track-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/xiaohuima_dong/article/details/44657871,BlogCommendFromBaidu_5&quot;}" data-track-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/xiaohuima_dong/article/details/44657871,BlogCommendFromBaidu_5&quot;}" data-flg="true">
    		<div class="content" style="width: 712px;">
    			<a href="https://blog.csdn.net/xiaohuima_dong/article/details/44657871" target="_blank" title="mmap函数用法及示例程序">
    			<h4 class="text-truncate oneline" style="width: 553px;">
    					<em>mmap</em><em>函数</em>用法及示例程序				</h4>
    			<div class="info-box d-flex align-content-center">
    				<p class="date-and-readNum oneline">
    					<span class="date hover-show">03-26</span>
    					<span class="read-num hover-hide">
              阅读数 
    						4300</span>
    					</p>
    				</div>
    			</a>
    				<p class="content" style="width: 712px;">
    					<a href="https://blog.csdn.net/xiaohuima_dong/article/details/44657871" target="_blank" title="mmap函数用法及示例程序">
    						<span class="desc oneline">UNIX网络编程第二卷进程间通信对mmap函数进行了说明。该函数主要用途有三个:1、将一个普通文件映射到内存中,通常在需要对文件进行频繁读写时使用,这样用内存读写取代I/O读写,以获得较高的性能;2、...</span>
    					</a>
    					  <span class="blog_title_box oneline ">
    						                <span class="type-show type-show-blog type-show-after">博文</span>
                                  <a target="_blank" href="https://blog.csdn.net/xiaohuima_dong">来自:	<span class="blog_title"> xiaohuima_dong的专栏</span></a>
                							              </span>
    				</p>
    		</div>
    				</div>
    
    
    
    		<div class="recommend-item-box recommend-box-ident type_blog clearfix" data-track-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/DLUTBruceZhang/article/details/9080173,BlogCommendFromBaidu_6&quot;}" data-track-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/DLUTBruceZhang/article/details/9080173,BlogCommendFromBaidu_6&quot;}" data-flg="true">
    		<div class="content" style="width: 712px;">
    			<a href="https://blog.csdn.net/DLUTBruceZhang/article/details/9080173" target="_blank" title="Linux 内存映射函数 mmap()函数详解">
    			<h4 class="text-truncate oneline" style="width: 553px;">
    					Linux <em>内存映射</em><em>函数</em> <em>mmap</em>()<em>函数</em><em>详解</em>				</h4>
    			<div class="info-box d-flex align-content-center">
    				<p class="date-and-readNum oneline">
    					<span class="date hover-show">06-12</span>
    					<span class="read-num hover-hide">
              阅读数 
    						3万+</span>
    					</p>
    				</div>
    			</a>
    				<p class="content" style="width: 712px;">
    					<a href="https://blog.csdn.net/DLUTBruceZhang/article/details/9080173" target="_blank" title="Linux 内存映射函数 mmap()函数详解">
    						<span class="desc oneline">一、概述&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;内存映射,简而言之就是将用户空间的一段内存区域映射到内核空间,映射成功后,用户对这段内存区域的修改可以直接反映到内核空间,同样,内核空间对这段区域的修改也直接反映用户空间。那么对于内...</span>
    					</a>
    					  <span class="blog_title_box oneline ">
    						                <span class="type-show type-show-blog type-show-after">博文</span>
                                  <a target="_blank" href="https://blog.csdn.net/DLUTBruceZhang">来自:	<span class="blog_title"> 张勤一</span></a>
                							              </span>
    				</p>
    		</div>
    				</div>
    
    
    
    		<div class="recommend-item-box recommend-box-ident type_blog clearfix" data-track-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/jklinux/article/details/72454427,BlogCommendFromBaidu_7&quot;}" data-track-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/jklinux/article/details/72454427,BlogCommendFromBaidu_7&quot;}" data-flg="true">
    		<div class="content" style="width: 712px;">
    			<a href="https://blog.csdn.net/jklinux/article/details/72454427" target="_blank" title="linux系统下动静态库的制作">
    			<h4 class="text-truncate oneline" style="width: 553px;">
    					linux系统下动静态库的制作				</h4>
    			<div class="info-box d-flex align-content-center">
    				<p class="date-and-readNum oneline">
    					<span class="date hover-show">05-17</span>
    					<span class="read-num hover-hide">
              阅读数 
    						564</span>
    					</p>
    				</div>
    			</a>
    				<p class="content" style="width: 712px;">
    					<a href="https://blog.csdn.net/jklinux/article/details/72454427" target="_blank" title="linux系统下动静态库的制作">
    						<span class="desc oneline">库: 就是代码编译出来的一种形式 动态库,静态库动态库:win系统上的dll文件,lin系统上的so文件.代码编译成一个独立的库, 不专属于一个程序.任何程序都可以共用这个库. 这个库不管多少程序调用...</span>
    					</a>
    					  <span class="blog_title_box oneline ">
    						                <span class="type-show type-show-blog type-show-after">博文</span>
                                  <a target="_blank" href="https://blog.csdn.net/jklinux">来自:	<span class="blog_title"> jklinux的博客</span></a>
                							              </span>
    				</p>
    		</div>
    				</div>
    
    
    
    		<div class="recommend-item-box recommend-box-ident type_blog clearfix" data-track-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/qq_35881819/article/details/77856002,BlogCommendFromBaidu_8&quot;}" data-track-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/qq_35881819/article/details/77856002,BlogCommendFromBaidu_8&quot;}" data-flg="true">
    		<div class="content" style="width: 712px;">
    			<a href="https://blog.csdn.net/qq_35881819/article/details/77856002" target="_blank" title="对于mmap函数错误的理解">
    			<h4 class="text-truncate oneline" style="width: 553px;">
    					对于<em>mmap</em><em>函数</em>错误的理解				</h4>
    			<div class="info-box d-flex align-content-center">
    				<p class="date-and-readNum oneline">
    					<span class="date hover-show">09-05</span>
    					<span class="read-num hover-hide">
              阅读数 
    						645</span>
    					</p>
    				</div>
    			</a>
    				<p class="content" style="width: 712px;">
    					<a href="https://blog.csdn.net/qq_35881819/article/details/77856002" target="_blank" title="对于mmap函数错误的理解">
    						<span class="desc oneline">今天在练习韦东山老师的第三期项目的时候出现了一个错误,在mmap中总是出现Can'tmmap也就是内存映射之后的返回值为(unsignedchar*)-1.找了很久终于解决了问题,出现问题的原因是因为...</span>
    					</a>
    					  <span class="blog_title_box oneline ">
    						                <span class="type-show type-show-blog type-show-after">博文</span>
                                  <a target="_blank" href="https://blog.csdn.net/qq_35881819">来自:	<span class="blog_title"> Milk_1997的博客</span></a>
                							              </span>
    				</p>
    		</div>
    				</div>
    
    <div class="recommend-item-box recommend-ad-box"><div id="kp_box_60" data-pid="60" data-track-view="{&quot;mod&quot;:&quot;kp_popu_60-43&quot;,&quot;con&quot;:&quot;,,&quot;}" data-track-click="{&quot;mod&quot;:&quot;kp_popu_60-43&quot;,&quot;con&quot;:&quot;,,&quot;}"><div id="three_ad8" class="mediav_ad"></div>
    
    Linux 内存映射函数 mmap()函数详解 - 幽雨雨幽 - CSDN博客

    11-17

    共享内存映射之mmap()函数详解 - 宇宙浪子的专栏 10-05 4206 本文 共享内存映射之mmap()函数详解    共享内存可以说是最有用的进程间通信方式,也是最快...

    Linux 内存映射函数 mmap()函数详解 - yangle4695的博客 - CSDN博客

    4-2

    共享内存映射之mmap()函数详解 10-05 阅读数 5104 本文共享内存映射之mmap(...博文 来自: 宇宙浪子的专栏 C语言中mmap()函数的使用 10-19 阅读数 1286...

    		<div class="recommend-item-box recommend-box-ident type_blog clearfix" data-track-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/l534145398/article/details/53283808,BlogCommendFromBaidu_9&quot;}" data-track-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/l534145398/article/details/53283808,BlogCommendFromBaidu_9&quot;}" data-flg="true">
    		<div class="content" style="width: 712px;">
    			<a href="https://blog.csdn.net/l534145398/article/details/53283808" target="_blank" title="mmap详解">
    			<h4 class="text-truncate oneline" style="width: 553px;">
    					<em>mmap</em><em>详解</em>				</h4>
    			<div class="info-box d-flex align-content-center">
    				<p class="date-and-readNum oneline">
    					<span class="date hover-show">11-22</span>
    					<span class="read-num hover-hide">
              阅读数 
    						1万+</span>
    					</p>
    				</div>
    			</a>
    				<p class="content" style="width: 712px;">
    					<a href="https://blog.csdn.net/l534145398/article/details/53283808" target="_blank" title="mmap详解">
    						<span class="desc oneline">转载自:http://www.cnblogs.com/techdoc/archive/2010/12/22/1913521.htmlmmap功能描述:mmap将一个文件或者其它对象映射进内存。文件被映...</span>
    					</a>
    					  <span class="blog_title_box oneline ">
    						                <span class="type-show type-show-blog type-show-after">博文</span>
                                  <a target="_blank" href="https://blog.csdn.net/l534145398">来自:	<span class="blog_title"> l534145398的博客</span></a>
                							              </span>
    				</p>
    		</div>
    				</div>
    
    
    
    		<div class="recommend-item-box recommend-box-ident type_blog clearfix" data-track-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/u012199908/article/details/78452256,BlogCommendFromBaidu_10&quot;}" data-track-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/u012199908/article/details/78452256,BlogCommendFromBaidu_10&quot;}" data-flg="true">
    		<div class="content" style="width: 712px;">
    			<a href="https://blog.csdn.net/u012199908/article/details/78452256" target="_blank" title="mmap">
    			<h4 class="text-truncate oneline" style="width: 553px;">
    					<em>mmap</em>				</h4>
    			<div class="info-box d-flex align-content-center">
    				<p class="date-and-readNum oneline">
    					<span class="date hover-show">11-05</span>
    					<span class="read-num hover-hide">
              阅读数 
    						767</span>
    					</p>
    				</div>
    			</a>
    				<p class="content" style="width: 712px;">
    					<a href="https://blog.csdn.net/u012199908/article/details/78452256" target="_blank" title="mmap">
    						<span class="desc oneline">mmap将一个文件或者其它对象映射进内存。文件被映射到多个页上,如果文件的大小不是所有页的大小之和,最后一个页不被使用的空间将会清零。mmap在用户空间映射调用系统中作用很大。void*mmap(vo...</span>
    					</a>
    					  <span class="blog_title_box oneline ">
    						                <span class="type-show type-show-blog type-show-after">博文</span>
                                  <a target="_blank" href="https://blog.csdn.net/u012199908">来自:	<span class="blog_title"> yingge2017的专栏</span></a>
                							              </span>
    				</p>
    		</div>
    				</div><div class="recommend-item-box baiduSearch recommend-box-ident" data-track-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/xingxu0207/article/details/60874061,searchFromBaidu1_2,-&quot;}" data-track-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/xingxu0207/article/details/60874061,searchFromBaidu1_2,-&quot;}" data-flg="true">                <a href="https://blog.csdn.net/xingxu0207/article/details/60874061" target="_blank">              		<h4 class="text-truncate oneline" style="width: 618px;">Linux <em>内存映射</em><em>函数</em> <em>mmap</em>()<em>函数</em><em>详解</em> - xingxu0207的博客 - CSDN博客</h4>                  <div class="info-box d-flex align-content-center">                    <p>                      <span class="date">11-7</span>                    </p>                  </div>              		<p class="content oneline" style="width: 712px;"></p>                </a>            	</div><div class="recommend-item-box baiduSearch recommend-box-ident" data-track-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/earbao/article/details/51535929,searchFromBaidu1_3,-&quot;}" data-track-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/earbao/article/details/51535929,searchFromBaidu1_3,-&quot;}" data-flg="true">                <a href="https://blog.csdn.net/earbao/article/details/51535929" target="_blank">              		<h4 class="text-truncate oneline" style="width: 609px;"><em>mmap</em>的使用之两个进程通过映射普通文件实现<em>共享</em>内存通..._CSDN博客</h4>                  <div class="info-box d-flex align-content-center">                    <p>                      <span class="date">11-22</span>                    </p>                  </div>              		<p class="content oneline" style="width: 712px;">共享内存映射之mmap()函数详解 - 宇宙浪子的专栏  10-05 4232  本文 共享内存映射之mmap()函数详解 &nbsp; &nbsp;共享内存可以说是最有用的进程间通信方式,也是最快...</p>                </a>            	</div>
    
    
          <div class="recommend-item-box blog-expert-recommend-box" style="display: block;">
    			<div class="d-flex">
    				<div class="blog-expert-recommend">
    					<div class="blog-expert">
    						<div class="blog-expert-flexbox" data-track-view="{&quot;mod&quot;:&quot;popu_709&quot;,&quot;con&quot;:&quot;https://blog.csdn.net/bluehawksky/article/details/39805565&quot;}"><div class="blog-expert-item"><div class="blog-expert-info-box"><div class="blog-expert-img-box" data-track-click="{&quot;mod&quot;:&quot;popu_709&quot;,&quot;con&quot;:&quot;https://blog.csdn.net/bluehawksky/article/details/39805565&quot;}"><a href="https://blog.csdn.net/hanqing280441589" target="_blank"><img src="https://avatar.csdn.net/4/B/5/3_hanqing280441589.jpg" alt="菜鸟-翡青" title="菜鸟-翡青"><svg class="icon" aria-hidden="true"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#csdnc-blogexpert"></use></svg></a><span data-track-click="{&quot;mod&quot;:&quot;popu_710&quot;,&quot;con&quot;:&quot;https://blog.csdn.net/bluehawksky/article/details/39805565&quot;}"><span class="blog-expert-button-follow btn-red-follow" data-name="hanqing280441589" data-nick="菜鸟-翡青">关注</span></span></div><div class="info"><span data-track-click="{&quot;mod&quot;:&quot;popu_709&quot;,&quot;con&quot;:&quot;https://blog.csdn.net/bluehawksky/article/details/39805565&quot;}"><a href="https://blog.csdn.net/hanqing280441589" target="_blank"><h5 class="oneline" title="菜鸟-翡青">菜鸟-翡青</h5></a></span>  <p></p><p class="article-num" title="218篇文章"> 218篇文章</p><p class="article-num" title="排名:888"> 排名:888</p><p></p></div></div></div><div class="blog-expert-item"><div class="blog-expert-info-box"><div class="blog-expert-img-box" data-track-click="{&quot;mod&quot;:&quot;popu_709&quot;,&quot;con&quot;:&quot;https://blog.csdn.net/bluehawksky/article/details/39805565&quot;}"><a href="https://blog.csdn.net/helloguoqijun" target="_blank"><img src="https://avatar.csdn.net/8/D/8/3_helloguoqijun.jpg" alt="放狼的爷们" title="放狼的爷们"></a><span data-track-click="{&quot;mod&quot;:&quot;popu_710&quot;,&quot;con&quot;:&quot;https://blog.csdn.net/bluehawksky/article/details/39805565&quot;}"><span class="blog-expert-button-follow btn-red-follow" data-name="helloguoqijun" data-nick="放狼的爷们">关注</span></span></div><div class="info"><span data-track-click="{&quot;mod&quot;:&quot;popu_709&quot;,&quot;con&quot;:&quot;https://blog.csdn.net/bluehawksky/article/details/39805565&quot;}"><a href="https://blog.csdn.net/helloguoqijun" target="_blank"><h5 class="oneline" title="放狼的爷们">放狼的爷们</h5></a></span>  <p></p><p class="article-num" title="86篇文章"> 86篇文章</p><p class="article-num" title="排名:千里之外"> 排名:千里之外</p><p></p></div></div></div><div class="blog-expert-item"><div class="blog-expert-info-box"><div class="blog-expert-img-box" data-track-click="{&quot;mod&quot;:&quot;popu_709&quot;,&quot;con&quot;:&quot;https://blog.csdn.net/bluehawksky/article/details/39805565&quot;}"><a href="https://blog.csdn.net/xxxxxlllllxl" target="_blank"><img src="https://avatar.csdn.net/8/B/6/3_xxxxxlllllxl.jpg" alt="Linux_Drv" title="Linux_Drv"></a><span data-track-click="{&quot;mod&quot;:&quot;popu_710&quot;,&quot;con&quot;:&quot;https://blog.csdn.net/bluehawksky/article/details/39805565&quot;}"><span class="blog-expert-button-follow btn-red-follow" data-name="xxxxxlllllxl" data-nick="Linux_Drv">关注</span></span></div><div class="info"><span data-track-click="{&quot;mod&quot;:&quot;popu_709&quot;,&quot;con&quot;:&quot;https://blog.csdn.net/bluehawksky/article/details/39805565&quot;}"><a href="https://blog.csdn.net/xxxxxlllllxl" target="_blank"><h5 class="oneline" title="Linux_Drv">Linux_Drv</h5></a></span>  <p></p><p class="article-num" title="51篇文章"> 51篇文章</p><p class="article-num" title="排名:千里之外"> 排名:千里之外</p><p></p></div></div></div><div class="blog-expert-item"><div class="blog-expert-info-box"><div class="blog-expert-img-box" data-track-click="{&quot;mod&quot;:&quot;popu_709&quot;,&quot;con&quot;:&quot;https://blog.csdn.net/bluehawksky/article/details/39805565&quot;}"><a href="https://blog.csdn.net/qq_32809273" target="_blank"><img src="https://avatar.csdn.net/4/5/5/3_qq_32809273.jpg" alt="qq_32809273" title="qq_32809273"></a><span data-track-click="{&quot;mod&quot;:&quot;popu_710&quot;,&quot;con&quot;:&quot;https://blog.csdn.net/bluehawksky/article/details/39805565&quot;}"><span class="blog-expert-button-follow btn-red-follow" data-name="qq_32809273" data-nick="qq_32809273">关注</span></span></div><div class="info"><span data-track-click="{&quot;mod&quot;:&quot;popu_709&quot;,&quot;con&quot;:&quot;https://blog.csdn.net/bluehawksky/article/details/39805565&quot;}"><a href="https://blog.csdn.net/qq_32809273" target="_blank"><h5 class="oneline" title="qq_32809273">qq_32809273</h5></a></span>  <p></p><p class="article-num" title="42篇文章"> 42篇文章</p><p class="article-num" title="排名:千里之外"> 排名:千里之外</p><p></p></div></div></div></div>
    					</div>
    				</div>
    			</div>
      </div>
    
    		<div class="recommend-item-box recommend-box-ident type_blog clearfix" data-track-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/duanbeibei/article/details/1707911,BlogCommendFromBaidu_11&quot;}" data-track-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/duanbeibei/article/details/1707911,BlogCommendFromBaidu_11&quot;}" data-flg="true">
    		<div class="content" style="width: 712px;">
    			<a href="https://blog.csdn.net/duanbeibei/article/details/1707911" target="_blank" title="mmap()">
    			<h4 class="text-truncate oneline" style="width: 553px;">
    					<em>mmap</em>()				</h4>
    			<div class="info-box d-flex align-content-center">
    				<p class="date-and-readNum oneline">
    					<span class="date hover-show">07-25</span>
    					<span class="read-num hover-hide">
              阅读数 
    						7646</span>
    					</p>
    				</div>
    			</a>
    				<p class="content" style="width: 712px;">
    					<a href="https://blog.csdn.net/duanbeibei/article/details/1707911" target="_blank" title="mmap()">
    						<span class="desc oneline">事例代码://------------------------------------------------mmap.c---------------------------------------...</span>
    					</a>
    					  <span class="blog_title_box oneline ">
    						                <span class="type-show type-show-blog type-show-after">博文</span>
                                  <a target="_blank" href="https://blog.csdn.net/duanbeibei">来自:	<span class="blog_title"> duanbeibei的专栏</span></a>
                							              </span>
    				</p>
    		</div>
    				</div><div class="recommend-item-box baiduSearch recommend-box-ident" data-track-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/hj605635529/article/details/73163513,searchFromBaidu1_4,-&quot;}" data-track-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/hj605635529/article/details/73163513,searchFromBaidu1_4,-&quot;}" data-flg="true">                <a href="https://blog.csdn.net/hj605635529/article/details/73163513" target="_blank">              		<h4 class="text-truncate oneline" style="width: 627px;"><em>mmap</em>映射区和shm<em>共享</em>内存的区别总结 - hj605635529的博..._CSDN博客</h4>                  <div class="info-box d-flex align-content-center">                    <p>                      <span class="date">4-1</span>                    </p>                  </div>              		<p class="content oneline" style="width: 712px;">共享内存映射之mmap()函数详解  10-05 阅读数 5094  本文共享内存映射之mmap(...博文 来自: 宇宙浪子的专栏  Linux共享内存(mmap详解)  08-01 阅读数 4912 ...</p>                </a>            	</div><div class="recommend-item-box baiduSearch recommend-box-ident" data-track-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/weixin_33795806/article/details/85972554,searchFromBaidu1_5,-&quot;}" data-track-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/weixin_33795806/article/details/85972554,searchFromBaidu1_5,-&quot;}" data-flg="true">                <a href="https://blog.csdn.net/weixin_33795806/article/details/85972554" target="_blank">              		<h4 class="text-truncate oneline" style="width: 618px;"><em>共享</em>内存简介和<em>mmap</em> <em>函数</em> - weixin_33795806的博客 - CSDN博客</h4>                  <div class="info-box d-flex align-content-center">                    <p>                      <span class="date">1-27</span>                    </p>                  </div>              		<p class="content oneline" style="width: 712px;">共享内存映射之mmap()函数详解 10-05 阅读数 4713  本文 共享内存映射之mmap(...来自: 宇宙浪子的专栏  使用mmap函数进行内核空间和用户空间的共享内存通信 01-...</p>                </a>            	</div>
    
    
    
    		<div class="recommend-item-box recommend-box-ident type_blog clearfix" data-track-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/varyall/article/details/80445603,BlogCommendFromBaidu_12&quot;}" data-track-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/varyall/article/details/80445603,BlogCommendFromBaidu_12&quot;}" data-flg="true">
    		<div class="content" style="width: 712px;">
    			<a href="https://blog.csdn.net/varyall/article/details/80445603" target="_blank" title="mmap()、munmap()的用法、例子">
    			<h4 class="text-truncate oneline" style="width: 553px;">
    					<em>mmap</em>()、munmap()的用法、例子				</h4>
    			<div class="info-box d-flex align-content-center">
    				<p class="date-and-readNum oneline">
    					<span class="date hover-show">05-25</span>
    					<span class="read-num hover-hide">
              阅读数 
    						605</span>
    					</p>
    				</div>
    			</a>
    				<p class="content" style="width: 712px;">
    					<a href="https://blog.csdn.net/varyall/article/details/80445603" target="_blank" title="mmap()、munmap()的用法、例子">
    						<span class="desc oneline">《Linux中C库mmap()函数详解》简介:&nbsp;Linux的mmap系统调用(libc封装了同名函数)可以分配一段匿名的虚拟内存区域,也可以映射一个文件到内存。&nbsp;mmap()必须以PAGE_SIZE为...</span>
    					</a>
    					  <span class="blog_title_box oneline ">
    						                <span class="type-show type-show-blog type-show-after">博文</span>
                                  <a target="_blank" href="https://blog.csdn.net/varyall">来自:	<span class="blog_title"> varyall的专栏</span></a>
                							              </span>
    				</p>
    		</div>
    				</div>
    
    
    
    		<div class="recommend-item-box recommend-box-ident type_blog clearfix" data-track-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/callinglove/article/details/46710465,BlogCommendFromGuangxin_13&quot;}" data-track-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/callinglove/article/details/46710465,BlogCommendFromGuangxin_13&quot;}" data-flg="true">
    		<div class="content" style="width: 712px;">
    			<a href="https://blog.csdn.net/callinglove/article/details/46710465" target="_blank" title="共享内存:mmap函数实现">
    			<h4 class="text-truncate oneline" style="width: 553px;">
    					<em>共享</em>内存:<em>mmap</em><em>函数</em>实现				</h4>
    			<div class="info-box d-flex align-content-center">
    				<p class="date-and-readNum oneline">
    					<span class="date hover-show">07-01</span>
    					<span class="read-num hover-hide">
              阅读数 
    						4322</span>
    					</p>
    				</div>
    			</a>
    				<p class="content" style="width: 712px;">
    					<a href="https://blog.csdn.net/callinglove/article/details/46710465" target="_blank" title="共享内存:mmap函数实现">
    						<span class="desc oneline">内存映射的应用:以页面为单位,将一个普通文件映射到内存中,通常在需要对文件进行频繁读写时使用,这样用内存读写取代I/O读写,以获得较高的性能;将特殊文件进行匿名内存映射,可以为关联进程提供共享内存空间...</span>
    					</a>
    					  <span class="blog_title_box oneline ">
    						                <span class="type-show type-show-blog type-show-after">博文</span>
                                  <a target="_blank" href="https://blog.csdn.net/callinglove">来自:	<span class="blog_title"> 一步一脚印</span></a>
                							              </span>
    				</p>
    		</div>
    				</div><div class="recommend-item-box baiduSearch recommend-box-ident" data-track-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/hustfoxy/article/details/8710307,searchFromBaidu1_6,-&quot;}" data-track-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/hustfoxy/article/details/8710307,searchFromBaidu1_6,-&quot;}" data-flg="true">                <a href="https://blog.csdn.net/hustfoxy/article/details/8710307" target="_blank">              		<h4 class="text-truncate oneline" style="width: 609px;">Linux<em>内存映射</em>——<em>mmap</em> - hustfoxy的专栏 - CSDN博客</h4>                  <div class="info-box d-flex align-content-center">                    <p>                      <span class="date">11-20</span>                    </p>                  </div>              		<p class="content oneline" style="width: 712px;">所谓的内存映射就是把物理内存映射到进程的地址空间之内,这些应用程序就可以直接使用输入输出的地址空间,从而提高读写的效率。Linux提供了mmap()函数,用来映射物理内存...</p>                </a>            	</div><div class="recommend-item-box baiduSearch recommend-box-ident" data-track-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/u013177568/article/details/62432116,searchFromBaidu1_7,-&quot;}" data-track-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/u013177568/article/details/62432116,searchFromBaidu1_7,-&quot;}" data-flg="true">                <a href="https://blog.csdn.net/u013177568/article/details/62432116" target="_blank">              		<h4 class="text-truncate oneline" style="width: 609px;"><em>mmap</em><em>函数</em>可能出现的问题 - u013177568的专栏 - CSDN博客</h4>                  <div class="info-box d-flex align-content-center">                    <p>                      <span class="date">10-18</span>                    </p>                  </div>              		<p class="content oneline" style="width: 712px;">本文 共享内存映射之mmap()函数详解 &nbsp; &nbsp;共享内存可以说是最有用的进程间...来自: 宇宙浪子的专栏  mmap函数用法及示例程序  03-26 4020  UNIX网络编程第...</p>                </a>            	</div>
    
    <div class="recommend-item-box recommend-ad-box"><div id="kp_box_61" data-pid="61" data-track-view="{&quot;mod&quot;:&quot;kp_popu_61-557&quot;,&quot;con&quot;:&quot;,,&quot;}" data-track-click="{&quot;mod&quot;:&quot;kp_popu_61-557&quot;,&quot;con&quot;:&quot;,,&quot;}"><div id="three_ad13" class="mediav_ad"></div>
    
    		<div class="recommend-item-box recommend-box-ident type_blog clearfix" data-track-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/kanwah200/article/details/40047211,BlogCommendFromGuangxin_14&quot;}" data-track-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/kanwah200/article/details/40047211,BlogCommendFromGuangxin_14&quot;}" data-flg="true">
    		<div class="content" style="width: 712px;">
    			<a href="https://blog.csdn.net/kanwah200/article/details/40047211" target="_blank" title="android mmap的使用">
    			<h4 class="text-truncate oneline" style="width: 553px;">
    					android <em>mmap</em>的使用				</h4>
    			<div class="info-box d-flex align-content-center">
    				<p class="date-and-readNum oneline">
    					<span class="date hover-show">10-13</span>
    					<span class="read-num hover-hide">
              阅读数 
    						4571</span>
    					</p>
    				</div>
    			</a>
    				<p class="content" style="width: 712px;">
    					<a href="https://blog.csdn.net/kanwah200/article/details/40047211" target="_blank" title="android mmap的使用">
    						<span class="desc oneline">共享内存可以说是最有用的进程间通信方式,也是最快的IPC形式,因为进程可以直接读写内存,而不需要任何数据的拷贝。对于像管道和消息队列等通信方式,则需要在内核和用户空间进行四次的数据拷贝,而共享内存则只...</span>
    					</a>
    					  <span class="blog_title_box oneline ">
    						                <span class="type-show type-show-blog type-show-after">博文</span>
                                  <a target="_blank" href="https://blog.csdn.net/kanwah200">来自:	<span class="blog_title"> kanwah200的专栏</span></a>
                							              </span>
    				</p>
    		</div>
    				</div><div class="recommend-item-box baiduSearch recommend-box-ident" data-track-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/qq973177663/article/details/51246267,searchFromBaidu1_8,-&quot;}" data-track-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/qq973177663/article/details/51246267,searchFromBaidu1_8,-&quot;}" data-flg="true">                <a href="https://blog.csdn.net/qq973177663/article/details/51246267" target="_blank">              		<h4 class="text-truncate oneline" style="width: 609px;">使用<em>mmap</em>实现一个文件输出<em>函数</em> - qq973177663的专栏 - CSDN博客</h4>                  <div class="info-box d-flex align-content-center">                    <p>                      <span class="date">11-20</span>                    </p>                  </div>              		<p class="content oneline" style="width: 712px;">共享内存映射之mmap()函数详解- 宇宙浪子的专栏  10-05 4216  本文 共享内存映射之mmap()函数详解 &nbsp; &nbsp;共享内存可以说是最有用的进程间通信方式,也是最快...</p>                </a>            	</div>
    
    
    
    		<div class="recommend-item-box recommend-box-ident type_blog clearfix" data-track-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/hj605635529/article/details/73163513,BlogCommendFromGuangxin_15&quot;}" data-track-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/hj605635529/article/details/73163513,BlogCommendFromGuangxin_15&quot;}" data-flg="true">
    		<div class="content" style="width: 712px;">
    			<a href="https://blog.csdn.net/hj605635529/article/details/73163513" target="_blank" title="mmap映射区和shm共享内存的区别总结">
    			<h4 class="text-truncate oneline" style="width: 553px;">
    					<em>mmap</em>映射区和shm<em>共享</em>内存的区别总结				</h4>
    			<div class="info-box d-flex align-content-center">
    				<p class="date-and-readNum oneline">
    					<span class="date hover-show">06-13</span>
    					<span class="read-num hover-hide">
              阅读数 
    						1万+</span>
    					</p>
    				</div>
    			</a>
    				<p class="content" style="width: 712px;">
    					<a href="https://blog.csdn.net/hj605635529/article/details/73163513" target="_blank" title="mmap映射区和shm共享内存的区别总结">
    						<span class="desc oneline">linux中的两种共享内存。一种是我们的IPC通信SystemV版本的共享内存,另外的一种就是我们今天提到的存储映射I/O(mmap函数)在说mmap之前我们先说一下普通的读写文件的原理,进程调用re...</span>
    					</a>
    					  <span class="blog_title_box oneline ">
    						                <span class="type-show type-show-blog type-show-after">博文</span>
                                  <a target="_blank" href="https://blog.csdn.net/hj605635529">来自:	<span class="blog_title"> hj605635529的博客</span></a>
                							              </span>
    				</p>
    		</div>
    				</div>
    
    
    
    		<div class="recommend-item-box recommend-box-ident type_blog clearfix" data-track-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/wuheshi/article/details/52911465,BlogCommendFromGuangxin_16&quot;}" data-track-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/wuheshi/article/details/52911465,BlogCommendFromGuangxin_16&quot;}" data-flg="true">
    		<div class="content" style="width: 712px;">
    			<a href="https://blog.csdn.net/wuheshi/article/details/52911465" target="_blank" title="Linux内核态和用户态共享内存">
    			<h4 class="text-truncate oneline" style="width: 553px;">
    					Linux内核态和用户态<em>共享</em>内存				</h4>
    			<div class="info-box d-flex align-content-center">
    				<p class="date-and-readNum oneline">
    					<span class="date hover-show">10-24</span>
    					<span class="read-num hover-hide">
              阅读数 
    						3237</span>
    					</p>
    				</div>
    			</a>
    				<p class="content" style="width: 712px;">
    					<a href="https://blog.csdn.net/wuheshi/article/details/52911465" target="_blank" title="Linux内核态和用户态共享内存">
    						<span class="desc oneline">Linux内核态和用户态共享内存1、mmap系统调用(功能)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;void*mmap(void*addr,size_tlen,intprot,intflags,intfd,off_toffset)...</span>
    					</a>
    					  <span class="blog_title_box oneline ">
    						                <span class="type-show type-show-blog type-show-after">博文</span>
                                  <a target="_blank" href="https://blog.csdn.net/wuheshi">来自:	<span class="blog_title"> 老五的作坊</span></a>
                							              </span>
    				</p>
    		</div>
    				</div>
    
    
    
    		<div class="recommend-item-box recommend-box-ident type_blog clearfix" data-track-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/helloguoqijun/article/details/78966885,BlogCommendFromQuerySearch_17&quot;}" data-track-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/helloguoqijun/article/details/78966885,BlogCommendFromQuerySearch_17&quot;}" data-flg="true">
    		<div class="content" style="width: 712px;">
    			<a href="https://blog.csdn.net/helloguoqijun/article/details/78966885" target="_blank" title="linux  mmap内存映射文件的理解">
    			<h4 class="text-truncate oneline" style="width: 553px;">
    					linux  <em>mmap</em><em>内存映射</em>文件的理解				</h4>
    			<div class="info-box d-flex align-content-center">
    				<p class="date-and-readNum oneline">
    					<span class="date hover-show">01-04</span>
    					<span class="read-num hover-hide">
              阅读数 
    						480</span>
    					</p>
    				</div>
    			</a>
    				<p class="content" style="width: 712px;">
    					<a href="https://blog.csdn.net/helloguoqijun/article/details/78966885" target="_blank" title="linux  mmap内存映射文件的理解">
    						<span class="desc oneline">利用ioremap访问硬件,需要经过两次拷贝1.明确:不管是在用户空间还是在内核空间,软件一律不能去直接访问设备的物理地址;2.在内核驱动中如果要访问设备的物理地址,需要利用ioremap将设备的物理...</span>
    					</a>
    					  <span class="blog_title_box oneline ">
    						                <span class="type-show type-show-blog type-show-after">博文</span>
                                  <a target="_blank" href="https://blog.csdn.net/helloguoqijun">来自:	<span class="blog_title"> 放狼的爷们</span></a>
                							              </span>
    				</p>
    		</div>
    				</div>
    
    
    
    		<div class="recommend-item-box recommend-box-ident type_blog clearfix" data-track-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/hanqing280441589/article/details/43882737,BlogCommendFromQuerySearch_18&quot;}" data-track-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/hanqing280441589/article/details/43882737,BlogCommendFromQuerySearch_18&quot;}" data-flg="true">
    		<div class="content" style="width: 712px;">
    			<a href="https://blog.csdn.net/hanqing280441589/article/details/43882737" target="_blank" title="Linux IPC实践(8) --共享内存/内存映射">
    			<h4 class="text-truncate oneline" style="width: 553px;">
    					Linux IPC实践(8) --<em>共享</em>内存/<em>内存映射</em>				</h4>
    			<div class="info-box d-flex align-content-center">
    				<p class="date-and-readNum oneline">
    					<span class="date hover-show">02-19</span>
    					<span class="read-num hover-hide">
              阅读数 
    						3148</span>
    					</p>
    				</div>
    			</a>
    				<p class="content" style="width: 712px;">
    					<a href="https://blog.csdn.net/hanqing280441589/article/details/43882737" target="_blank" title="Linux IPC实践(8) --共享内存/内存映射">
    						<span class="desc oneline">概述&nbsp;&nbsp;共享内存区是最快的IPC形式。一旦这样的内存映射到共享它的进程的地址空间,这些进程间数据传递不再涉及到内核,换句话说是进程不再通过执行进入内核的系统调用来传递彼此的数据(如图)。&nbsp;共享内存&nbsp;V...</span>
    					</a>
    					  <span class="blog_title_box oneline ">
    						                <span class="type-show type-show-blog type-show-after">博文</span>
                                  <a target="_blank" href="https://blog.csdn.net/hanqing280441589">来自:	<span class="blog_title"> 菜鸟-翡青</span></a>
                							              </span>
    				</p>
    		</div>
    				</div>
    
    <div class="recommend-item-box recommend-ad-box"><div id="kp_box_62" data-pid="62" data-track-view="{&quot;mod&quot;:&quot;kp_popu_62-556&quot;,&quot;con&quot;:&quot;,,&quot;}" data-track-click="{&quot;mod&quot;:&quot;kp_popu_62-556&quot;,&quot;con&quot;:&quot;,,&quot;}"><div id="three_ad18" class="mediav_ad"></div>
    
    		<div class="recommend-item-box recommend-box-ident type_blog clearfix" data-track-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/xxxxxlllllxl/article/details/17303231,BlogCommendFromQuerySearch_19&quot;}" data-track-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/xxxxxlllllxl/article/details/17303231,BlogCommendFromQuerySearch_19&quot;}" data-flg="true">
    		<div class="content" style="width: 712px;">
    			<a href="https://blog.csdn.net/xxxxxlllllxl/article/details/17303231" target="_blank" title="进程与内存4-mmap实现1(nopage方法原理及实例)">
    			<h4 class="text-truncate oneline" style="width: 553px;">
    					进程与内存4-<em>mmap</em>实现1(nopage方法原理及实例)				</h4>
    			<div class="info-box d-flex align-content-center">
    				<p class="date-and-readNum oneline">
    					<span class="date hover-show">12-13</span>
    					<span class="read-num hover-hide">
              阅读数 
    						3095</span>
    					</p>
    				</div>
    			</a>
    				<p class="content" style="width: 712px;">
    					<a href="https://blog.csdn.net/xxxxxlllllxl/article/details/17303231" target="_blank" title="进程与内存4-mmap实现1(nopage方法原理及实例)">
    						<span class="desc oneline">假设现在有个有个驱动,有一段内存叫做sh_mem。当用户打开这个文件并mmap。mmap要做什么,当然是建立用户态的地址与此驱动建立对应关系。我知道的有两种:1.我们给用户提供一个方法,如果你要用这个...</span>
    					</a>
    					  <span class="blog_title_box oneline ">
    						                <span class="type-show type-show-blog type-show-after">博文</span>
                                  <a target="_blank" href="https://blog.csdn.net/xxxxxlllllxl">来自:	<span class="blog_title"> xxxxxlllllxl的专栏</span></a>
                							              </span>
    				</p>
    		</div>
    				</div>
    
    
    
    		<div class="recommend-item-box recommend-box-ident type_blog clearfix" data-track-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/qq_32809273/article/details/52894051,BlogCommendFromQuerySearch_20&quot;}" data-track-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/qq_32809273/article/details/52894051,BlogCommendFromQuerySearch_20&quot;}" data-flg="true">
    		<div class="content" style="width: 712px;">
    			<a href="https://blog.csdn.net/qq_32809273/article/details/52894051" target="_blank" title="mmap之内存映射文件与常规文件操作比较">
    			<h4 class="text-truncate oneline" style="width: 553px;">
    					<em>mmap</em>之<em>内存映射</em>文件与常规文件操作比较				</h4>
    			<div class="info-box d-flex align-content-center">
    				<p class="date-and-readNum oneline">
    					<span class="date hover-show">10-22</span>
    					<span class="read-num hover-hide">
              阅读数 
    						389</span>
    					</p>
    				</div>
    			</a>
    				<p class="content" style="width: 712px;">
    					<a href="https://blog.csdn.net/qq_32809273/article/details/52894051" target="_blank" title="mmap之内存映射文件与常规文件操作比较">
    						<span class="desc oneline">阅读目录mmap基础概念mmap内存映射原理mmap和常规文件操作的区别mmap优点总结mmap相关函数mmap使用细节回到顶部mmap基础概念mmap是一种内存映射文件的方法,即将一个文件或者其它对...</span>
    					</a>
    					  <span class="blog_title_box oneline ">
    						                <span class="type-show type-show-blog type-show-after">博文</span>
                                  <a target="_blank" href="https://blog.csdn.net/qq_32809273">来自:	<span class="blog_title"> 等鱼煎的博客</span></a>
                							              </span>
    				</p>
    		</div>
    				</div>
    
    
    
    		<div class="recommend-item-box recommend-box-ident type_blog clearfix" data-track-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/kanguolaikanguolaik/article/details/44892979,BlogCommendFromQuerySearch_21&quot;}" data-track-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/kanguolaikanguolaik/article/details/44892979,BlogCommendFromQuerySearch_21&quot;}" data-flg="true">
    		<div class="content" style="width: 712px;">
    			<a href="https://blog.csdn.net/kanguolaikanguolaik/article/details/44892979" target="_blank" title="Linux C:磁盘文件映射到内存/mmap()">
    			<h4 class="text-truncate oneline" style="width: 553px;">
    					Linux C:磁盘文件映射到内存/<em>mmap</em>()				</h4>
    			<div class="info-box d-flex align-content-center">
    				<p class="date-and-readNum oneline">
    					<span class="date hover-show">04-05</span>
    					<span class="read-num hover-hide">
              阅读数 
    						1519</span>
    					</p>
    				</div>
    			</a>
    				<p class="content" style="width: 712px;">
    					<a href="https://blog.csdn.net/kanguolaikanguolaik/article/details/44892979" target="_blank" title="Linux C:磁盘文件映射到内存/mmap()">
    						<span class="desc oneline">一、代码&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#include&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mmap()1.1文件myfile&nbsp;&nbsp;&nbsp;&nbsp;需要事先准备好的文件内容:1.2代码#include#include#includeintmain(intargc...</span>
    					</a>
    					  <span class="blog_title_box oneline ">
    						                <span class="type-show type-show-blog type-show-after">博文</span>
                                  <a target="_blank" href="https://blog.csdn.net/kanguolaikanguolaik">来自:	<span class="blog_title"> kanguolaikanguolaik的专栏</span></a>
                							              </span>
    				</p>
    		</div>
    				</div>
    
    
    
    		<div class="recommend-item-box recommend-box-ident type_blog clearfix" data-track-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/yzy1103203312/article/details/78286360,BlogCommendFromThirdServiceAll_22&quot;}" data-track-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/yzy1103203312/article/details/78286360,BlogCommendFromThirdServiceAll_22&quot;}" data-flg="true">
    		<div class="content" style="width: 712px;">
    			<a href="https://blog.csdn.net/yzy1103203312/article/details/78286360" target="_blank" title="C语言中mmap()函数的使用">
    			<h4 class="text-truncate oneline" style="width: 553px;">
    					C语言中<em>mmap</em>()<em>函数</em>的使用				</h4>
    			<div class="info-box d-flex align-content-center">
    				<p class="date-and-readNum oneline">
    					<span class="date hover-show">10-19</span>
    					<span class="read-num hover-hide">
              阅读数 
    						1382</span>
    					</p>
    				</div>
    			</a>
    				<p class="content" style="width: 712px;">
    					<a href="https://blog.csdn.net/yzy1103203312/article/details/78286360" target="_blank" title="C语言中mmap()函数的使用">
    						<span class="desc oneline">mmap()函数的主要用途有三个:1、将一个普通文件映射到内存中,通常在需要对文件进行频繁读写时使用,这样用内存读写取代I/O读写,以获得较高的性能;2、将特殊文件进行匿名内存映射,可以为关联进程提供...</span>
    					</a>
    					  <span class="blog_title_box oneline ">
    						                <span class="type-show type-show-blog type-show-after">博文</span>
                                  <a target="_blank" href="https://blog.csdn.net/yzy1103203312">来自:	<span class="blog_title"> 为幸福写歌的博客</span></a>
                							              </span>
    				</p>
    		</div>
    				</div>
    
    
    
    		<div class="recommend-item-box recommend-box-ident type_blog clearfix" data-track-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/xhu_eternalcc/article/details/38454741,BlogCommendFromThirdServiceAll_23&quot;}" data-track-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/xhu_eternalcc/article/details/38454741,BlogCommendFromThirdServiceAll_23&quot;}" data-flg="true">
    		<div class="content" style="width: 712px;">
    			<a href="https://blog.csdn.net/xhu_eternalcc/article/details/38454741" target="_blank" title="文件内存映射mmap解决大文件快速读写问题和进程间共享内存">
    			<h4 class="text-truncate oneline" style="width: 553px;">
    					文件<em>内存映射</em><em>mmap</em>解决大文件快速读写问题和进程间<em>共享</em>内存				</h4>
    			<div class="info-box d-flex align-content-center">
    				<p class="date-and-readNum oneline">
    					<span class="date hover-show">08-09</span>
    					<span class="read-num hover-hide">
              阅读数 
    						4093</span>
    					</p>
    				</div>
    			</a>
    				<p class="content" style="width: 712px;">
    					<a href="https://blog.csdn.net/xhu_eternalcc/article/details/38454741" target="_blank" title="文件内存映射mmap解决大文件快速读写问题和进程间共享内存">
    						<span class="desc oneline">mmap函数主要用途有三个:1、将一个普通文件映射到内存中,通常在需要对文件进行频繁读写时使用,这样用内存读写取代I/O读写,以获得较高的性能;2、将特殊文件进行匿名内存映射,可以为关联进程提供共享内...</span>
    					</a>
    					  <span class="blog_title_box oneline ">
    						                <span class="type-show type-show-blog type-show-after">博文</span>
                                  <a target="_blank" href="https://blog.csdn.net/xhu_eternalcc">来自:	<span class="blog_title"> enockipp的小'码'头</span></a>
                							              </span>
    				</p>
    		</div>
    				</div>
    
    <div class="recommend-item-box recommend-ad-box"><div id="kp_box_63" data-pid="63" data-track-view="{&quot;mod&quot;:&quot;kp_popu_63-555&quot;,&quot;con&quot;:&quot;,,&quot;}" data-track-click="{&quot;mod&quot;:&quot;kp_popu_63-555&quot;,&quot;con&quot;:&quot;,,&quot;}"><div id="three_ad23" class="mediav_ad"></div>
    
    		<div class="recommend-item-box recommend-box-ident type_blog clearfix" data-track-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/gernie/article/details/52886638,BlogCommendFromThirdServiceAll_24&quot;}" data-track-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/gernie/article/details/52886638,BlogCommendFromThirdServiceAll_24&quot;}" data-flg="true">
    		<div class="content" style="width: 712px;">
    			<a href="https://blog.csdn.net/gernie/article/details/52886638" target="_blank" title="C语言中include引用顺序的小常识">
    			<h4 class="text-truncate oneline" style="width: 553px;">
    					C语言中include引用顺序的小常识				</h4>
    			<div class="info-box d-flex align-content-center">
    				<p class="date-and-readNum oneline">
    					<span class="date hover-show">10-21</span>
    					<span class="read-num hover-hide">
              阅读数 
    						2831</span>
    					</p>
    				</div>
    			</a>
    				<p class="content" style="width: 712px;">
    					<a href="https://blog.csdn.net/gernie/article/details/52886638" target="_blank" title="C语言中include引用顺序的小常识">
    						<span class="desc oneline">在C语言中,我们常用include去引用一个头文件。比如:#include。平时我们编程时很少关心头文件的引用顺序。其实,头文件的引用顺序对于程序的编译还是有一定影响的。此处记录一个小常识,以加强对该...</span>
    					</a>
    					  <span class="blog_title_box oneline ">
    						                <span class="type-show type-show-blog type-show-after">博文</span>
                                  <a target="_blank" href="https://blog.csdn.net/gernie">来自:	<span class="blog_title"> gernie的博客</span></a>
                							              </span>
    				</p>
    		</div>
    				</div>
    
    
    
    		<div class="recommend-item-box recommend-box-ident type_blog clearfix" data-track-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/sinat_36384705/article/details/61427901,BlogCommendFromThirdServiceAll_25&quot;}" data-track-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/sinat_36384705/article/details/61427901,BlogCommendFromThirdServiceAll_25&quot;}" data-flg="true">
    		<div class="content" style="width: 712px;">
    			<a href="https://blog.csdn.net/sinat_36384705/article/details/61427901" target="_blank" title="read()函数参数理解">
    			<h4 class="text-truncate oneline" style="width: 553px;">
    					read()<em>函数</em>参数理解				</h4>
    			<div class="info-box d-flex align-content-center">
    				<p class="date-and-readNum oneline">
    					<span class="date hover-show">03-11</span>
    					<span class="read-num hover-hide">
              阅读数 
    						8403</span>
    					</p>
    				</div>
    			</a>
    				<p class="content" style="width: 712px;">
    					<a href="https://blog.csdn.net/sinat_36384705/article/details/61427901" target="_blank" title="read()函数参数理解">
    						<span class="desc oneline">在read()函数里,有Linux给出的定义NAME&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;read-readfromafiledescriptor&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#include&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ssize_tread(intfd,vo...</span>
    					</a>
    					  <span class="blog_title_box oneline ">
    						                <span class="type-show type-show-blog type-show-after">博文</span>
                                  <a target="_blank" href="https://blog.csdn.net/sinat_36384705">来自:	<span class="blog_title"> sinat_36384705的博客</span></a>
                							              </span>
    				</p>
    		</div>
    				</div>
    
    
    
    		<div class="recommend-item-box recommend-box-ident type_blog clearfix" data-track-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/zdmilan/article/details/1585537,BlogCommendFromBaidu_26&quot;}" data-track-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/zdmilan/article/details/1585537,BlogCommendFromBaidu_26&quot;}" data-flg="true">
    		<div class="content" style="width: 712px;">
    			<a href="https://blog.csdn.net/zdmilan/article/details/1585537" target="_blank" title="Linux-mmap函数介绍">
    			<h4 class="text-truncate oneline" style="width: 553px;">
    					Linux-<em>mmap</em><em>函数</em>介绍				</h4>
    			<div class="info-box d-flex align-content-center">
    				<p class="date-and-readNum oneline">
    					<span class="date hover-show">04-26</span>
    					<span class="read-num hover-hide">
              阅读数 
    						1万+</span>
    					</p>
    				</div>
    			</a>
    				<p class="content" style="width: 712px;">
    					<a href="https://blog.csdn.net/zdmilan/article/details/1585537" target="_blank" title="Linux-mmap函数介绍">
    						<span class="desc oneline">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mmap函数是unix/linux下的系统调用,来看《UnixNetwordprogramming》卷二12.2节对mmap的介绍:Themmapfunctionmapseitheraf...</span>
    					</a>
    					  <span class="blog_title_box oneline ">
    						                <span class="type-show type-show-blog type-show-after">博文</span>
                                  <a target="_blank" href="https://blog.csdn.net/zdmilan">来自:	<span class="blog_title"> 路过蜻蜓</span></a>
                							              </span>
    				</p>
    		</div>
    				</div>
    
    
    
    		<div class="recommend-item-box recommend-box-ident type_blog clearfix" data-track-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/zhouyu_peng/article/details/31786125,BlogCommendFromBaidu_27&quot;}" data-track-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/zhouyu_peng/article/details/31786125,BlogCommendFromBaidu_27&quot;}" data-flg="true">
    		<div class="content" style="width: 712px;">
    			<a href="https://blog.csdn.net/zhouyu_peng/article/details/31786125" target="_blank" title="mmap函数">
    			<h4 class="text-truncate oneline" style="width: 553px;">
    					<em>mmap</em><em>函数</em>				</h4>
    			<div class="info-box d-flex align-content-center">
    				<p class="date-and-readNum oneline">
    					<span class="date hover-show">06-17</span>
    					<span class="read-num hover-hide">
              阅读数 
    						250</span>
    					</p>
    				</div>
    			</a>
    				<p class="content" style="width: 712px;">
    					<a href="https://blog.csdn.net/zhouyu_peng/article/details/31786125" target="_blank" title="mmap函数">
    						<span class="desc oneline">函数定义为:#includevoid*mmap(void*start,&nbsp;size_t&nbsp;length,intprot,intflags,intfd,off_toffset);intmunmap(void...</span>
    					</a>
    					  <span class="blog_title_box oneline ">
    						                <span class="type-show type-show-blog type-show-after">博文</span>
                                  <a target="_blank" href="https://blog.csdn.net/zhouyu_peng">来自:	<span class="blog_title"> zhouyu_peng的专栏</span></a>
                							              </span>
    				</p>
    		</div>
    				</div>
    
    
    
    		<div class="recommend-item-box recommend-box-ident type_blog clearfix" data-track-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/sean_hy2009/article/details/5744428,BlogCommendFromBaidu_28&quot;}" data-track-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/sean_hy2009/article/details/5744428,BlogCommendFromBaidu_28&quot;}" data-flg="true">
    		<div class="content" style="width: 712px;">
    			<a href="https://blog.csdn.net/sean_hy2009/article/details/5744428" target="_blank" title="mmap函数详解">
    			<h4 class="text-truncate oneline" style="width: 553px;">
    					<em>mmap</em><em>函数</em><em>详解</em>				</h4>
    			<div class="info-box d-flex align-content-center">
    				<p class="date-and-readNum oneline">
    					<span class="date hover-show">07-18</span>
    					<span class="read-num hover-hide">
              阅读数 
    						788</span>
    					</p>
    				</div>
    			</a>
    				<p class="content" style="width: 712px;">
    					<a href="https://blog.csdn.net/sean_hy2009/article/details/5744428" target="_blank" title="mmap函数详解">
    						<span class="desc oneline">mmap(内存映射,memorymap)函数的作用是建立一段内存,使它能够被两个或者更多的程序读写。一个程序对它所做的修改可以被&nbsp;其他程序看见。&nbsp;这一功能还可以用在文件的处理上。你可以使某个磁盘文件的...</span>
    					</a>
    					  <span class="blog_title_box oneline ">
    						                <span class="type-show type-show-blog type-show-after">博文</span>
                                  <a target="_blank" href="https://blog.csdn.net/sean_hy2009">来自:	<span class="blog_title"> sean_hy2009的专栏</span></a>
                							              </span>
    				</p>
    		</div>
    				</div>
    
    <div class="recommend-item-box recommend-ad-box"><div id="kp_box_64" data-pid="64" data-track-view="{&quot;mod&quot;:&quot;kp_popu_64-901&quot;,&quot;con&quot;:&quot;,,&quot;}" data-track-click="{&quot;mod&quot;:&quot;kp_popu_64-901&quot;,&quot;con&quot;:&quot;,,&quot;}"><script async="" src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
    

    width="963" height="187" vspace="0" hspace="0" scrolling="no" allowfullscreen="true" id="aswift_0">

    		<div class="recommend-item-box recommend-box-ident type_blog clearfix" data-track-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/iteye_17063/article/details/82249480,BlogCommendFromBaidu_29&quot;}" data-track-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/iteye_17063/article/details/82249480,BlogCommendFromBaidu_29&quot;}" data-flg="true">
    		<div class="content" style="width: 712px;">
    			<a href="https://blog.csdn.net/iteye_17063/article/details/82249480" target="_blank" title="mmap的详细使用及函数参数意义">
    			<h4 class="text-truncate oneline" style="width: 553px;">
    					<em>mmap</em>的详细使用及<em>函数</em>参数意义				</h4>
    			<div class="info-box d-flex align-content-center">
    				<p class="date-and-readNum oneline">
    					<span class="date hover-show">01-17</span>
    					<span class="read-num hover-hide">
              阅读数 
    						28</span>
    					</p>
    				</div>
    			</a>
    				<p class="content" style="width: 712px;">
    					<a href="https://blog.csdn.net/iteye_17063/article/details/82249480" target="_blank" title="mmap的详细使用及函数参数意义">
    						<span class="desc oneline">mmap的详细使用及函数参数意义2011年07月03日  mmap    功能描述:    mmap将一个文件或者其它对象映射进内存。文件被映射到多个页上,如果文件的大小不是所有页的大小之和,最后一个...</span>
    					</a>
    					  <span class="blog_title_box oneline ">
    						                <span class="type-show type-show-blog type-show-after">博文</span>
                                  <a target="_blank" href="https://blog.csdn.net/iteye_17063">来自:	<span class="blog_title"> xdq406at</span></a>
                							              </span>
    				</p>
    		</div>
    				</div>
    
    
    
    		<div class="recommend-item-box recommend-box-ident type_blog clearfix" data-track-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/renlonggg/article/details/78133987,BlogCommendFromBaidu_30&quot;}" data-track-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/renlonggg/article/details/78133987,BlogCommendFromBaidu_30&quot;}" data-flg="true">
    		<div class="content" style="width: 712px;">
    			<a href="https://blog.csdn.net/renlonggg/article/details/78133987" target="_blank" title="mmap 访问DDR,加了 O_RDWR| O_SYNC,仍不能同步">
    			<h4 class="text-truncate oneline" style="width: 553px;">
    					<em>mmap</em> 访问DDR,加了 O_RDWR| O_SYNC,仍不能同步				</h4>
    			<div class="info-box d-flex align-content-center">
    				<p class="date-and-readNum oneline">
    					<span class="date hover-show">09-29</span>
    					<span class="read-num hover-hide">
              阅读数 
    						486</span>
    					</p>
    				</div>
    			</a>
    				<p class="content" style="width: 712px;">
    					<a href="https://blog.csdn.net/renlonggg/article/details/78133987" target="_blank" title="mmap 访问DDR,加了 O_RDWR| O_SYNC,仍不能同步">
    						<span class="desc oneline">请教一个问题,mmap访问ddr,为什么写个数据下去,不能同步到物理地址,我加了O_RDWR|O_SYNC;按理说是同步的啊?解决办法:待研究,哪位遇到同样问题一起交流一下啊,私信我...</span>
    					</a>
    					  <span class="blog_title_box oneline ">
    						                <span class="type-show type-show-blog type-show-after">博文</span>
                                  <a target="_blank" href="https://blog.csdn.net/renlonggg">来自:	<span class="blog_title"> renlong_cdut的博客</span></a>
                							              </span>
    				</p>
    		</div>
    				</div>
    
    
    
    		<div class="recommend-item-box recommend-box-ident type_blog clearfix" data-track-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/weixin_38239856/article/details/77389844,BlogCommendFromBaidu_31&quot;}" data-track-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/weixin_38239856/article/details/77389844,BlogCommendFromBaidu_31&quot;}" data-flg="true">
    		<div class="content" style="width: 712px;">
    			<a href="https://blog.csdn.net/weixin_38239856/article/details/77389844" target="_blank" title="【C语言】【unix c】使用mmap将文件映射到进程的虚拟地址空间,然后对内存的操作直接反应到文件中">
    			<h4 class="text-truncate oneline" style="width: 553px;">
    					【C语言】【unix c】使用<em>mmap</em>将文件映射到进程的虚拟地址空间,然后对内存的操作直接反应到文件中				</h4>
    			<div class="info-box d-flex align-content-center">
    				<p class="date-and-readNum oneline">
    					<span class="date hover-show">08-19</span>
    					<span class="read-num hover-hide">
              阅读数 
    						672</span>
    					</p>
    				</div>
    			</a>
    				<p class="content" style="width: 712px;">
    					<a href="https://blog.csdn.net/weixin_38239856/article/details/77389844" target="_blank" title="【C语言】【unix c】使用mmap将文件映射到进程的虚拟地址空间,然后对内存的操作直接反应到文件中">
    						<span class="desc oneline">【C语言】【unixc】使用mmap将文件映射到进程的虚拟地址空间,然后对内存的操作直接反应到文件中...</span>
    					</a>
    					  <span class="blog_title_box oneline ">
    						                <span class="type-show type-show-blog type-show-after">博文</span>
                                  <a target="_blank" href="https://blog.csdn.net/weixin_38239856">来自:	<span class="blog_title"> 独孤星燎</span></a>
                							              </span>
    				</p>
    		</div>
    				</div>
    
    
    
    		<div class="recommend-item-box recommend-box-ident type_blog clearfix" data-track-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/go_Michael/article/details/6127174,BlogCommendFromBaidu_32&quot;}" data-track-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/go_Michael/article/details/6127174,BlogCommendFromBaidu_32&quot;}" data-flg="true">
    		<div class="content" style="width: 712px;">
    			<a href="https://blog.csdn.net/go_Michael/article/details/6127174" target="_blank" title="内存映射相关函数">
    			<h4 class="text-truncate oneline" style="width: 553px;">
    					<em>内存映射</em>相关<em>函数</em>				</h4>
    			<div class="info-box d-flex align-content-center">
    				<p class="date-and-readNum oneline">
    					<span class="date hover-show">01-10</span>
    					<span class="read-num hover-hide">
              阅读数 
    						1228</span>
    					</p>
    				</div>
    			</a>
    				<p class="content" style="width: 712px;">
    					<a href="https://blog.csdn.net/go_Michael/article/details/6127174" target="_blank" title="内存映射相关函数">
    						<span class="desc oneline">本文介绍利用内存映射文件修改大文件:在大文件内存前加入一段数据,若要使用内存映射文件,必须执行下列操作步骤:创建或打开一个文件内核对象,该对象用于标识磁盘上你想用作内存映射文件的文件;创建一个文件映射...</span>
    					</a>
    					  <span class="blog_title_box oneline ">
    						                <span class="type-show type-show-blog type-show-after">博文</span>
                                  <a target="_blank" href="https://blog.csdn.net/go_Michael">来自:	<span class="blog_title"> go_Michael的专栏</span></a>
                							              </span>
    				</p>
    		</div>
    				</div>
    
    
    
    		<div class="recommend-item-box recommend-box-ident type_blog clearfix" data-track-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/tangzihao_c/article/details/52402979,BlogCommendFromBaidu_33&quot;}" data-track-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/tangzihao_c/article/details/52402979,BlogCommendFromBaidu_33&quot;}" data-flg="true">
    		<div class="content" style="width: 712px;">
    			<a href="https://blog.csdn.net/tangzihao_c/article/details/52402979" target="_blank" title="Day25、malloc 内存分配、mmap内存映射、文件的操作(文件描述符、open\close\read)">
    			<h4 class="text-truncate oneline" style="width: 553px;">
    					Day25、malloc 内存分配、<em>mmap</em><em>内存映射</em>、文件的操作(文件描述符、open\close\read)				</h4>
    			<di
    
    评论
    添加红包

    请填写红包祝福语或标题

    红包个数最小为10个

    红包金额最低5元

    当前余额3.43前往充值 >
    需支付:10.00
    成就一亿技术人!
    领取后你会自动成为博主和红包主的粉丝 规则
    hope_wisdom
    发出的红包
    实付
    使用余额支付
    点击重新获取
    扫码支付
    钱包余额 0

    抵扣说明:

    1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
    2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

    余额充值