strchrnul(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 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:

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