VM_MAP_INSERT(9)

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

πŸ’… VM_MAP_INSERT(9) ✨

okay bestie, this is straight from the Kernel Developer's Manual, and it's the entry for vm_map_insert β€” the function that inserts an object into a map. no cap, it's giving kernel-internals main character energy 🫢


🌸 NAME 🌸

vm_map_insert β€” insert an object into a map


✨ SYNOPSIS ✨

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

int
vm_map_insert(vm_map_t map, vm_object_t object, vm_ooffset_t offset,
    vm_offset_t start, vm_offset_t end, vm_prot_t prot, vm_prot_t max,
    int cow);

πŸ’– DESCRIPTION πŸ’–

The vm_map_insert() function inserts a mapping for the entire vm_object object into the target map β€” yes, the variable is literally named map, iykyk πŸ’…

The offset argument specifies the offset into the object at which to begin mapping. The object's size should match that of the specified address range β€” keep that energy aligned, bestie 🫢

The start and end arguments specify the bounds of the mapped object's window in the address space of map.

The cow argument specifies the flags which should be propagated to the new entry, for example, to indicate that this is a copy-on-write mapping. Also, the signature carries prot and max, both vm_prot_t β€” keep them exactly as shown in the synopsis. ✨


🧚 IMPLEMENTATION NOTES 🧚

This function implicitly creates a new vm_map_entry by calling the internal function vm_map_entry_create(). so it's giving delegation, not DIY 🧚


πŸŽ€ RETURN VALUES πŸŽ€

The vm_map_insert() function returns KERN_SUCCESS if the mapping could be made successfully. πŸ’–

Otherwise, it's one of these:

  • KERN_INVALID_ADDRESS β€” returned if the start of the range could not be found.
  • KERN_NO_SPACE β€” returned if the range was found to be part of an existing entry or if it overlaps the end of the map.

πŸ¦‹ SEE ALSO πŸ¦‹

vm_map(9)


πŸ‘‘ AUTHORS πŸ‘‘

This manual page was written by Bruce M Simpson <bms@spc.org>. ty for your service, king πŸ‘‘


k byeee πŸ’… β€” source/version: Debian, date: January 11, 2013, page: VM_MAP_INSERT(9). mwah πŸŽ€

πŸ“¦ where this page comes from