Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
In addition to MAP_PRIVATE and MAP_SHARED, Linux allows a number of other values to be included (ORed) in the mmap() flags argument. Table 49-3 summarizes these values. Other than MAP_PRIVATE and MAP_SHARED, only the MAP_FIXED flag is specified in SUSv3.
| Value | Description | SUSv3 |
|---|---|---|
| MAP_ANONYMOUS | Create an anonymous mapping | |
| MAP_FIXED | Interpret addr argument exactly (Section 49.10) | • |
| MAP_LOCKED | Lock mapped pages into memory (since Linux 2.6) | |
| MAP_HUGETLB | Create a mapping that uses huge pages (since Linux 2.6.32) | |
| MAP_NORESERVE | Control reservation of swap space (Section 49.9) | |
| MAP_PRIVATE | Modifications to mapped data are private | • |
| MAP_POPULATE | Populate the pages of a mapping (since Linux 2.6) | • |
| MAP_SHARED | Modifications to mapped data are visible to other processes and propagated to underlying file (converse of MAP_PRIVATE) | • |
| MAP_UNINITIALIZED | Don’t clear an anonymous mapping (since Linux 2.6.33) |