Memory Management API

System calls for memory allocation, mapping, and protection.

API entry from apis.yml

apis.yml Raw ↑
name: Memory Management API
description: System calls for memory allocation, mapping, and protection.
image: https://kinlane-productions.s3.amazonaws.com/apis-json/apis-json-logo.jpg
humanURL: https://man7.org/linux/man-pages/man2/mmap.2.html
baseURL: system://unix/memory
tags:
- Allocation
- Memory
- Mmap
- Virtual-Memory
properties:
- type: Documentation
  url: https://pubs.opengroup.org/onlinepubs/9699919799/functions/mmap.html
- type: APIReference
  url: https://man7.org/linux/man-pages/man2/mmap.2.html
operations:
- name: brk
  description: Change data segment size
  parameters:
  - addr
  returns: 0 on success, -1 on error
- name: sbrk
  description: Change data segment size
  parameters:
  - increment
  returns: previous program break
- name: mmap
  description: Map files or devices into memory
  parameters:
  - addr
  - length
  - prot
  - flags
  - fd
  - offset
  returns: pointer to mapped area
- name: munmap
  description: Unmap files or devices from memory
  parameters:
  - addr
  - length
  returns: 0 on success, -1 on error
- name: mprotect
  description: Set protection on a region of memory
  parameters:
  - addr
  - len
  - prot
  returns: 0 on success, -1 on error
- name: mlock
  description: Lock memory into RAM
  parameters:
  - addr
  - len
  returns: 0 on success, -1 on error
- name: munlock
  description: Unlock memory from RAM
  parameters:
  - addr
  - len
  returns: 0 on success, -1 on error
- name: msync
  description: Synchronize a memory-mapped file with its underlying storage
  parameters:
  - addr
  - length
  - flags
  returns: 0 on success, -1 on error
- name: madvise
  description: Give advice about use of memory to the kernel
  parameters:
  - addr
  - length
  - advice
  returns: 0 on success, -1 on error
- name: posix_memalign
  description: Allocate aligned memory
  parameters:
  - memptr
  - alignment
  - size
  returns: 0 on success, error number on failure
- name: shm_open
  description: Create or open a POSIX shared memory object
  parameters:
  - name
  - oflag
  - mode
  returns: file descriptor
- name: shm_unlink
  description: Remove a POSIX shared memory object
  parameters:
  - name
  returns: 0 on success, -1 on error