kunit_kstrdup(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ¦‹ kunit_kstrdup β€” Kernel API Manual πŸ¦‹

okay so bestie, welcome to the kunit_kstrdup(9) page in the Kernel API Manual! this one is short and sweet: it's the KUnit girlie that copies a string into a test managed allocation. let's get into it πŸ’…

🌸 NAME 🌸

kunit_kstrdup β€” duplicates a string into a test managed allocation.

✨ SYNOPSIS ✨

char * kunit_kstrdup (struct kunit *test , const char *str , gfp_t gfp
);

πŸŽ€ ARGUMENTS πŸŽ€

  • test β€” the test context object. your test's main character energy.
  • str β€” the NULL-terminated string to duplicate. yes, NULL-terminated, bestie.
  • gfp β€” flags passed to underlying kmalloc. that's the flag tea.

πŸ’– DESCRIPTION πŸ’–

so kunit_kstrdup duplicates a string into a test managed allocation. for more information, see kstrdup and kunit_kmalloc_array. that's literally the whole description β€” no cap, it's giving "small API, big test-energy" 🫢

πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./include/kunit/test.h β€” and the whole KUnit cinematic universe:

bye bestie β€” this page is from source ./include/kunit, page kunit_kstrdup(9), dated October 2026 πŸ’–βœ¨

πŸ“¦ where this page comes from