Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

49. Memory Mappings > The MAP_FIXED Flag

The MAP_FIXED Flag

Specifying MAP_FIXED in the mmap() flags argument forces the kernel to interpret the address in addr exactly, rather than take it as a hint. If we specify MAP_FIXED, addr must be page-aligned.

Generally, a portable application should omit the use of MAP_FIXED, and specify addr as NULL, which allows the system to choose the address at which to place the mapping. The reasons for this are the same as those that we outlined in Using Shared Memory when explaining why it usually preferable to specify shmaddr as NULL when attaching a System V shared memory segment using shmat().


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint