strncmp(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… strncmp(9) β€” like, the Kernel API Manual one, bestie ✨

Okay so before we even get into it: yes, this is a page from the Kernel API Manual, section 9, and the star of the show is strncmp. She compares two strings but β€” and this is the whole personality β€” only up to a byte limit. Length-limited. Capped. Boundaries set. We love a queen with standards πŸŽ€


🌸 NAME 🌸

strncmp β€” compare two length-limited strings, fr fr 🫢

✨ SYNOPSIS ✨

int strncmp (const char *cs , const char *ct , size_t count );

That's the whole vibe. Three things in, an int out. Slay πŸ’…

πŸ¦‹ ARGUMENTS πŸ¦‹

  • cs β€” one string. Just a string. The first one. The main character, arguably πŸ‘‘
  • ct β€” another string. The other one. The one cs is getting compared against 🌈
  • count β€” the maximum number of bytes to compare. Like, the maximum. It will not look at a single byte past this, and honestly? Respect πŸ™ˆ

πŸ’– SEE ALSO πŸ’–

So you're in the kernel file ./lib/string.c, which means you have options, bestie. The whole friend group is here:

No cap, that's a whole squad. Go say hi to them, iykyk 🧚


Lowkey a little reminder from your girl: count is the maximum number of bytes to compare. Maximum. It's giving "know your limits" and it's iconic 🌸

okay bye, ily, go compare some strings responsibly πŸ’œ

β€” from ./lib, dated October 2026, signing off with a πŸŽ€ and a strncmp(9) πŸ’…βœ¨

πŸ“¦ where this page comes from