strnlen(9)
πΈ NAME πΈ
okay bestie, welcome to the Kernel API Manual entry for strnlen(9) π
β¨
strnlen β returns a bounded count of characters in a NUL-terminated string π
β¨ SYNOPSIS β¨
__kernel_size_t strnlen (const char * const p , __kernel_size_t maxlen
);
π¦ ARGUMENTS π¦
pβ pointer to the NUL-terminated string you're counting, bestie π«Άmaxlenβ the maximum number of characters to count, no cap π
π DESCRIPTION π
So here's the vibe: it returns the number of characters in p β and NOT including the final NUL, okay? π β or it returns maxlen if no NUL has been found up to there πβ¨
That's literally the whole thing. Iconic behavior, zero drama π
π SEE ALSO π
- Kernel file
./include/linux/fortify-string.hunsafe_memcpy(9),strlen(9),strlcat(9),strcat(9),strncat(9),strcpy(9)π¦π
mwah π this page's source/version is ./include/linux, dated October 2026 β periodt, bestie π«Άπ
π¦ 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