pub const MadviseError = error AccessDeniedadvice is MADV.REMOVE, but the specified address range is not a shared writable mapping.
PermissionDeniedadvice is MADV.HWPOISON, but the caller does not have the CAP_SYS_ADMIN capability.
SystemResourcesA kernel resource was temporarily unavailable.
InvalidSyscallOne of the following:
WouldExceedMaximumResidentSetSize(for MADV.WILLNEED) Paging in this area would exceed the process's maximum resident set size.
OutOfMemoryOne of the following:
MadviseUnavailableThe madvise syscall is not available on this version and configuration of the Linux kernel.
UnexpectedThe operating system returned an undocumented error code.
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404pub const MadviseError = error{
/// advice is MADV.REMOVE, but the specified address range is not a shared writable mapping.
AccessDenied,
/// advice is MADV.HWPOISON, but the caller does not have the CAP_SYS_ADMIN capability.
PermissionDenied,
/// A kernel resource was temporarily unavailable.
SystemResources,
/// 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.
InvalidSyscall,
/// (for MADV.WILLNEED) Paging in this area would exceed the process's
/// maximum resident set size.
WouldExceedMaximumResidentSetSize,
/// 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.
OutOfMemory,
/// The madvise syscall is not available on this version and configuration
/// of the Linux kernel.
MadviseUnavailable,
/// The operating system returned an undocumented error code.
Unexpected,
}