分类:
2010-01-23 20:48:25
The prot argument describes the desired memory protection (and must not conflict with the open mode of the file). It is either PROT_NONE or is the bitwise OR of one or more of the other PROT_* flags.
注意需要指定fd文件指针,当是-1时,申请匿名页
fd should be a valid file descriptor, unless MAP_ANONYMOUS is set. If MAP_ANONYMOUS is set, then fd is ignored on Linux. However, some implementations require fd to be -1 ifMAP_ANONYMOUS (or MAP_ANON) is specified, and portable applications should ensure this.