strnstr(9)
okay so bestie, welcome to the strnstr(9) kernel API manual page β yes we're doing kernel string lore today, and it's lowkey iconic. Let's get into it. π
β¨ NAME β¨
strnstr β Find the first substring in a length-limited string. That's the whole vibe: you have a string, you have a length limit, and you're hunting for the first substring inside it. π
π¦ SYNOPSIS π¦
char * strnstr (const char *s1 , const char *s2 , size_t len );
π ARGUMENTS π
s1β The string to be searched. This is the main character you're digging through. πs2β The string to search for. The little substring you're trying to find in there. πlenβ the maximum number of characters to search. Basically the search boundary, bestie; don't go past it. β¨
π SEE ALSO π
Kernel file ./lib/string.c plus this whole squad of related functions:
strncasecmp(9)stpcpy(9)strcmp(9)strncmp(9)strchr(9)strchrnul(9)strnchrnul(9)strrchr(9)strnchr(9)strspn(9)strcspn(9)strpbrk(9)strsep(9)memset(9)memset16(9)memset32(9)memset64(9)memcpy(9)memmove(9)memcmp(9)bcmp(9)memscan(9)strstr(9)memchr(9)memchr_inv(9)
and that's the strnstr(9) page, bestie β source ./lib, dated October 2026. periodt. πβ¨
π¦ 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