Memory operation
Memory Operation¶
Memory allocation¶
Memory copy¶
map or unmap file or device into memory
*addr : specify the starting address
* addr == NULL : the kernel choose to create the mapping
* addr != NULL : the kernel take it as a hint to place
* `length` : the length of the mapping
-
proc: desire memory protection of the mapping -
fd、offset、length:The content of file mapping are initialize using length byte starting at offset in the file fd
Retuen value * Success : Return a pointer to the mapped area * On error : Return MAP_FAILED ((void*) -1)
Delete the mapping for the specified address range
Return values * Success : Return 0 * Failure : Return -1