Linux-memory ing file MMAP

Source: Internet
Author: User

 

Best references:

1. Master from the Internet.

2. UNP V2 posix ipc chapter 12.

3. Linux man command.

Article 1: MMAP function Purpose

1. Map common files to the process memory space for memory ing Io.

2. Map special files to the process memory space for anonymous memory ing Io.

3. Map shm_open to open the POSIX shared memory zone to the memory space of the process, which can provide data sharing and IO among unrelated processes.

# Include <sys/Mman. h>

 

Void * MMAP (void * _ ADDR, size_t _ Len, int _ Prot, int _ flags, int _ FD, off_t _ offset ); // The offset value must be an integer multiple of sysconf (_ SC _page_size. The default value is 0. // The Len and offset values must be within the actual size range of the file referenced by FD. If not mapped, an error is reported during read/write operations.

Int munmap (void * _ ADDR, size_t _ Len );

Int mprotect (void * _ ADDR, size_t _ Len, int _ prot );

Int msync (void * _ ADDR, size_t _ Len, int _ flags );

It's easy to understand the 12 chapters of man and unpv2 ~~~ ^_^.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.