It requests a private, writable anonymous mapping of n bytes of memory.
- A closed display means that it is not shared with other processes (for example, after
fork() child and parent elements will have independent mappings); - Anonymous mapping means that it is not supported by the file.
In this case, it essentially requests a block of n bytes of memory, which is roughly equivalent to malloc(n) (although it needs to be freed using munmap() and not free() , and it will be page aligned). It also requests that the memory be writable, but does not request that it be readable, however, writable and unreadable memory is usually not a combination supported by the underlying hardware. When PROT_WRITE only PROT_WRITE , POSIX allows the implementation to provide memory that can also be read and / or executed.
caf
source share