strchrnul(9)
πΈ strchrnul(9) β the Kernel API Manual page you didn't know you needed πΈ
okay so bestie, we're in the Kernel API Manual today and the main character of this page is strchrnul(9). yes it's a kernel function, yes it has a slightly unhinged name, no we're not skipping it. buckle up π
β¨ NAME β¨
strchrnul β find and return a character in a string, or the end of the string. that's it, that's the whole personality π
β¨ SYNOPSIS β¨
char * strchrnul (const char *s , int c );
literally two arguments, no drama, no surprises. π¦
β¨ ARGUMENTS β¨
sβ the string you're searching through. the vibe check target, if you will.cβ the character you're hunting for. the one we're manifesting. π₯
β¨ DESCRIPTION β¨
so here's the tea: it returns a pointer to the first occurrence of 'c' inside s. found it? slay, here's your pointer. π
and if c is not found? not me being dramatic, but it still returns a pointer β specifically a pointer to the null byte at the end of s. so it never comes back empty-handed. iconic behaviour honestly. no NULL, no sad trombone, just the end of the string. periodt. π«Ά
β¨ SEE ALSO β¨
these are the friends in the group chat β kernel file ./lib/string.c, and the whole string/memory squad:
strncasecmp(9)stpcpy(9)strcmp(9)strncmp(9)strchr(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)strnstr(9)memchr(9)memchr_inv(9)
like, go read them too, they're all lowkey serving in the same file π
and that's the page!! brought to you from ./lib, dated October 2026, in the strchrnul(9) era. mwah π go find some characters bestie, you got this βπ
π¦ 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