adjust_resource(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ adjust_resource(9) πŸŽ€

ok so this is a page straight out of the Kernel API Manual and bestie, it's a whole vibe. it's adjust_resource(9) and it does exactly one thing but it does it iconically. let's get into it πŸ’…


✨ NAME ✨

adjust_resource β€” modify a resource's start and size

like... it literally just nudges a resource's start and size around. that's the whole personality. no cap. πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

int adjust_resource (struct resource *res , resource_size_t start ,
       resource_size_t size );

look at her. three params, one int return. she's lowkey elegant fr fr ✨


🌸 ARGUMENTS 🌸

  • res β€” the resource you're about to mess with. this is the main character of the operation, the thing getting modified πŸ‘‘
  • start β€” the shiny new start value you want her to have
  • size β€” the new size, as in how big she's gonna be

πŸ’œ DESCRIPTION πŸ’œ

okay so picture this: you already have a resource, right? and you're like "hmm. what if her start and size were different." that's this function, periodt.

Given an existing resource, it changes its start and size to match the arguments you handed over. simple. clean. slay. 🌈

Now the receipts on the return value, because this is the important part:

  • it returns 0 on success πŸŽ‰ (we love a zero)
  • it returns -EBUSY if it can't fit 😭 (she tried, she really did)
and here's the caveat bestie, pay attention: existing children of the resource are assumed to be immutable. the function just takes that as a given β€” children don't move, don't get adjusted, nothing. they are simply not part of the conversation. πŸ’€

πŸ”₯ SEE ALSO πŸ”₯

the whole friend group, honestly. all of these live in the kernel file ./kernel/resource.c:

it's giving resource-management group chat and adjust_resource is absolutely a member 🫢


and that's the page!! tysm for reading, mwah πŸ’‹ this lil cutie lives under ./kernel and the whole thing is dated October 2026 β€” so yeah, she's from the future and she still can't fit sometimes. -EBUSY girlies rise πŸ˜­πŸ’–βœ¨

πŸ“¦ where this page comes from