__compat_vma_mmap(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… __compat_vma_mmap(9)

okay so bestie, welcome to the kernel API manual page for __compat_vma_mmap(9) β€” yes that's the manual name, it's giving "underscore-underscore" main character energy and we're obsessed 🫢


✨ NAME ✨

__compat_vma_mmap β€” literally the same vibe as compat_vma_mmap(), except it's flexible about how the mmap_prepare callback gets invoked. which is super useful for drivers that invoke nested mmap_prepare callbacks inside an mmap() hook. iykyk πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

int __compat_vma_mmap (struct vm_area_desc *desc , struct vm_area_struct
*vma );

🌸 ARGUMENTS 🌸

  • desc β€” a VMA descriptor that has already had an mmap_prepare hook executed on it. like, done, dusted, no takebacks ✨
  • vma β€” the VMA that desc should be applied to. matching energies, fr fr πŸ¦‹

πŸ’– DESCRIPTION πŸ’–

so this function is lowkey assuming a whole lot about you: it assumes you've already gotten yourself a VMA descriptor desc from compat_set_desc_from_vma, and that you've already executed the mmap_prepare hook on it. like, girl, do your homework first 😭

after that, it performs any specified mmap actions, and then it invokes the vm_ops->mapped hook if one is present. slay πŸ”₯

for more details, go read the description of compat_vma_mmap β€” it's got the lore πŸ‘‘

heads up bestie: once the conversion of drivers is complete, this function will no longer be required and will be removed. so don't get too attached, it's a limited-edition drop πŸ’€

⭐ RETURN ⭐

0 on success, or error. that's it, that's the whole mood πŸŽ€


🌈 SEE ALSO 🌈

kernel file ./mm/util.c, plus the whole friend group:


and that's the whole page, bestie 🧚 coming at you straight from the ./mm directory, dated October 2026 β€” __compat_vma_mmap(9) out, mwah πŸ’œπŸ’œπŸ’œ

πŸ“¦ where this page comes from