fill_random_string(9)
π 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 π
- Kernel file
./lib/tests/string_kunit.c strscpy_check(9)alloc_max_bench_buffer(9)STRING_BENCH(9)STRING_BENCH_BUF(9)
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms