首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C语言 >

请问一个关于mmap的有关问题

2012-03-28 
请教一个关于mmap的问题各位同仁好,在mmap中,有一个函数的参数是你打开的文件的文件描述符,如果这个参数是

请教一个关于mmap的问题
各位同仁好,在mmap中,有一个函数的参数是你打开的文件的文件描述符,如果这个参数是-1会事什么效果!往赐教

[解决办法]

MAP_ANON
Synonym for MAP_ANONYMOUS. Deprecated.

MAP_ANONYMOUS
The mapping is not backed by any file; its contents are initialized to zero. The fd and offset arguments are ignored; however, some imple‐
mentations require fd to be -1 if MAP_ANONYMOUS (or MAP_ANON) is specified, and portable applications should ensure this. The use of
MAP_ANONYMOUS in conjunction with MAP_SHARED is only supported on Linux since kernel 2.4.

热点排行