fill_random_string(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… fill_random_string(9) πŸ’…

okay so bestie, welcome to the Kernel API Manual</> β€” yes that's the manual name, we're fancy here ✨


πŸŽ€ NAME πŸŽ€

fill_random_string β€” literally populates a buffer with a random NUL-terminated</> string. that's it. that's the whole job. and it ate πŸ’…


✨ SYNOPSIS ✨

void fill_random_string (char *buf , size_t len );

no cap, that's the whole signature. two args. nothing else. iconic behaviour honestly 🫢


🌸 ARGUMENTS 🌸

  • buf β€” the buffer you're filling up, bestie. this is the one getting the random glow-up πŸ’–
  • len β€” length of that buffer, in bytes. like, how much room it's got. count it right or it's giving chaos 😭

πŸ¦‹ DESCRIPTION πŸ¦‹

so what it does is β€” it fills the buffer with random non-NUL</> bytes, then makes sure the string is properly NUL-terminated</> at the end. so you get a nice little random string that's valid and terminated and ready to go. main character energy fr fr πŸ‘‘


🌈 SEE ALSO 🌈

go read those too, iykyk πŸ§šπŸ’œ


lowkey a reminder: this page lives in ./lib/tests, dated October 2026 β€” so yeah, that's the source and version, periodt πŸ’€βœ¨

stay random, stay terminated πŸ’–πŸŽ€πŸ¦‹πŸŒΈπŸ’…

πŸ“¦ where this page comes from