kunit_add_named_resource(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– kunit_add_named_resource (9) πŸ’–

okay so bestie, welcome to the Kernel API Manual β€” yes that's the manual name, we're fancy here πŸ‘‘ β€” and today's main character is kunit_add_named_resource, which literally does what it says on the tin: it adds a named test managed resource. no cap. πŸŽ€


✨ NAME ✨

kunit_add_named_resource β€” add a named test managed resource. that's it, that's the vibe. πŸ’…


🌸 SYNOPSIS 🌸

int kunit_add_named_resource (struct kunit *test , kunit_resource_init_t
init , kunit_resource_free_t free , struct kunit_resource *res , const
char *name , void *data );

she takes six arguments and returns an int, and honestly? she ate. πŸ”₯


πŸ¦‹ ARGUMENTS πŸ¦‹

  • test β€” the test context object. the whole situation lives inside this, she's the main character energy of the call fr fr.
  • init β€” a user-supplied function to initialize the resource data, if needed. you bring the setup, she brings the vibes.
  • free β€” a user-supplied function to free the resource data, if needed. the cleanup crew 🧹 β€” again, only if needed, no pressure.
  • res β€” the resource. like, the actual resource resource. iconic.
  • name β€” name to be set for resource. give her a name, she deserves one πŸ’–.
  • data β€” value to pass to init function or set in resource data field. whatever you hand over goes straight to init or into the resource's data field, so pack accordingly πŸ“.

πŸ’œ SEE ALSO πŸ’œ

like, go read these too, they're all part of the same friend group 🫢 β€” straight from the kernel file ./include/kunit/resource.h:


lowkey important bestie: this page came from ./include/kunit, dated October 2026 β€” so when you cite her, cite her right πŸ˜­πŸ’€

and that's the whole page!! go add those named test managed resources, you absolute legend πŸŒˆβ­πŸ’…

πŸ“¦ where this page comes from