Munmap v0.1.0

Source
Removes a virtual-memory mapping.

Package: Linux

Signature

func Munmap(addr: *opaque, length: uint) -> int64;

Parameters

NameTypeDescription
addr*opaquePage-aligned start of the range to unmap.
lengthuintNumber of bytes in the range.

Returns

int640 on success, or a negative errno result on failure.

Description

After a successful call, accessing the unmapped range is invalid. The address must be page-aligned; Linux rounds length up to a page boundary.

Example

import Linux::{ IsError, Munmap };

func Main() -> int {
    if IsError(Munmap(memory, 4096u)) {
        return 1;
    }
    return 0;
}

See also

  • Mmap — create a mapping