kmemdup_nul(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… kmemdup_nul β€” Kernel API Manual, bestie edition ✨

okay so welcome to the Kernel API Manual page for kmemdup_nul, the little function with main-character energy for turning unterminated data into a NUL-terminated string. no cap, that's literally the vibe check. 🫢

πŸŽ€ NAME πŸŽ€

kmemdup_nul β€” Create a NUL-terminated string from unterminated data πŸ’–

🌸 SYNOPSIS 🌸

char * kmemdup_nul (const char *s , size_t len , gfp_t gfp );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • s β€” The data to stringify. πŸ“
  • len β€” The size of the data. 🌸
  • gfp β€” the GFP mask used in the kmalloc call when allocating memory. ✨

πŸ’– RETURN πŸ’–

You get a newly allocated copy of s with NUL-termination, or NULL in case of error. periodt. 🫢

πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./mm/util.c β€” plus the whole SEE ALSO friend group:

whew, that's the page πŸ’… source/version: ./mm; date: October 2026; page: kmemdup_nul(9) β€” signing off, bestie 🫢✨

πŸ“¦ where this page comes from