strsep(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… strsep(9) β€” the kernel API manual, bestie edition πŸŽ€

okay so this is strsep, straight out of the Kernel API Manual, and honestly? she's that girl. lowkey one of the most useful little string-splitters in the whole kernel and she knows it. let's get into it ✨


✨ NAME ✨

strsep β€” split a string into tokens πŸ“


πŸ¦‹ SYNOPSIS πŸ¦‹

char * strsep (char **s , const char *ct );

yes the spacing is weird, no we're not fixing it, that's just how she's printed. slay πŸ’…


🌸 ARGUMENTS 🌸

  • s β€” the string to be searched πŸ‘€ (it's a char ** bestie, she's getting updated, keep reading)
  • ct β€” the characters to search for πŸ”

πŸ‘‘ DESCRIPTION πŸ‘‘

so here's the main character moment: strsep updates s to point after the token, ready for the next call. that's the whole vibe. call her, she eats the token, she bumps s forward, you call her again. iconic loop energy fr fr πŸ’–

and here's the thing nobody expects: it returns empty tokens, too. like, yes, genuinely, empty ones. it behaves exactly like the libc function of that name β€” no cap, same semantics. in fact, it was stolen from glibc2 and de-fancy-fied. same semantics, slimmer shape. ;) 🧚

not me obsessed with a kernel function that literally admits it was stolen from glibc2 and then "de-fancy-fied" 😭 the audacity, the confidence, we stan

🌈 SEE ALSO 🌈

kernel file ./lib/string.c, plus the whole friend group right here β€” go say hi to all of them 🫢


and that's the page!! πŸ’œ this little love letter lives in ./lib and it's dated October 2026 β€” so go split some strings, bestie, and remember: strsep(9) said it first. mwah πŸŽ€πŸ’–βœ¨

πŸ“¦ where this page comes from