VM_MAP_MADVISE(9)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1, nixpkgs unstable

πŸ’… vm_map_madvise β€” apply advice about use of memory to map entries

Okay so bestie, this one is from the Kernel Developer’s Manual, section 9, and it’s literally the function that applies advice about how memory is used to map entries. Very β€œI’m the helper your kernel calls” energy. ✨


🌸 NAME 🌸

vm_map_madvise β€” apply advice about use of memory to map entries

πŸŽ€ SYNOPSIS πŸŽ€

#include <sys/param.h>
#include <vm/vm.h>
#include <vm/vm_map.h>

int
vm_map_madvise(vm_map_t map, vm_offset_t start, vm_offset_t end,
    int behav);

πŸ¦‹ DESCRIPTION πŸ¦‹

So like, vm_map_madvise() takes the flags in behav and applies them to the entries inside map between start and end. That’s the whole vibe. πŸ’–

Advisories are classified as either those affecting the vm_map_entry structure, or those affecting the underlying objects. Both categories are a thing, and the function is aware of the difference. No cap.

Also important: vm_map_madvise() is used by the madvise(2) system call. So when that syscall is out here giving advice, this function is lowkey doing the map-entry part of the work. 🫢

⭐ RETURN VALUES ⭐

vm_map_madvise() returns 0 if successful. Slay.

If the behav argument was not recognised, KERN_INVALID_ARGUMENT is returned. That’s the β€œbestie, I don’t know this flag” outcome. πŸ’€

🌈 SEE ALSO 🌈

πŸ‘‘ AUTHORS πŸ‘‘

This manual page was written by Bruce M Simpson <bms@spc.org>. Iconic behavior, honestly. πŸŽ€


And that’s the page, bestie β€” this copy came from Debian, dated July 19, 2003. Historical cuteness, preserved. πŸ’œ

πŸ“¦ where this page comes from