strncmp(9)
π 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 onecsis 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:
strncasecmp(9)stpcpy(9)strcmp(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)strnstr(9)memchr(9)memchr_inv(9)
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
- 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