error{AccessDenied, PermissionDenied, SystemResources, InvalidSyscall, WouldExceedMaximumResidentSetSize, OutOfMemory, MadviseUnavailable, Unexpected}
(ErrorSet)

Errors

AccessDenied

advice is MADV.REMOVE, but the specified address range is not a shared writable mapping.

InvalidSyscall

One of the following:

  • addr is not page-aligned or length is negative
  • advice is not valid
  • advice is MADV.DONTNEED or MADV.REMOVE and the specified address range includes locked, Huge TLB pages, or VM_PFNMAP pages.
  • advice is MADV.MERGEABLE or MADV.UNMERGEABLE, but the kernel was not configured with CONFIG_KSM.
  • advice is MADV.FREE or MADV.WIPEONFORK but the specified address range includes file, Huge TLB, MAP.SHARED, or VM_PFNMAP ranges.
MadviseUnavailable

The madvise syscall is not available on this version and configuration of the Linux kernel.

OutOfMemory

One of the following:

  • (for MADV.WILLNEED) Not enough memory: paging in failed.
  • Addresses in the specified range are not currently mapped, or are outside the address space of the process.
PermissionDenied

advice is MADV.HWPOISON, but the caller does not have the CAP_SYS_ADMIN capability.

SystemResources

A kernel resource was temporarily unavailable.

Unexpected

The operating system returned an undocumented error code.

WouldExceedMaximumResidentSetSize

(for MADV.WILLNEED) Paging in this area would exceed the process’s maximum resident set size.