VM_MAP_INHERIT(9)

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

πŸ’– VM_MAP_INHERIT(9) πŸ’–

okay so bestie, welcome to VM_MAP_INHERIT(9) β€” yep, the Kernel Developer's Manual page, and it's literally about setting fork inheritance flags for a range inside a map. Very main-character kernel energy. 🫢


✨ NAME ✨

vm_map_inherit β€” set fork inheritance flags for a range within a map. no cap, that's the whole vibe. πŸ’…


🌸 SYNOPSIS 🌸

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

int
vm_map_inherit(vm_map_t map, vm_offset_t start, vm_offset_t end,
    vm_inherit_t new_inheritance);

πŸ¦‹ DESCRIPTION πŸ¦‹

so the vm_map_inherit() function sets the inheritance flags for the range from start to end within the target map to the value new_inheritance. that's it, that's the assignment. πŸ’–

the new_inheritance flag has to be one of these three icons πŸ‘‘:

  • VM_INHERIT_NONE
  • VM_INHERIT_COPY
  • VM_INHERIT_SHARE

and this is what affects how the map will be shared with child maps when the associated process forks. yes, fork(2) behavior, we're in it. πŸ”₯


πŸŽ€ IMPLEMENTATION NOTES πŸŽ€

the vm_map_inherit() function obtains a lock on the map using vm_map_lock(9) for the duration of the function. she locks in, literally. πŸ”’βœ¨


🌈 RETURN VALUES 🌈

vm_map_inherit() returns KERN_SUCCESS if the inheritance flags could be set. slay. βœ…

otherwise, if the provided flags were invalid, KERN_INVALID_ARGUMENT will be returned. not slay, but important. πŸ’€


🧚 SEE ALSO 🧚

iykyk, go read that one too. πŸ“


πŸ’œ AUTHORS πŸ’œ

this manual page was written by Bruce M Simpson <bms@spc.org>. iconic behavior, honestly. πŸ‘‘


and that's the whole page, bestie. source/version: Debian. date: July 19, 2003. mwah, kisses from the manual footer πŸ’‹πŸ’–

πŸ“¦ where this page comes from