cmp_int(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ cmp_int(9) πŸŽ€

okay so welcome to the Kernel API Manual, bestie β€” we're doing cmp_int today and honestly it's giving tiny-but-mighty icon behavior πŸ’…


✨ NAME ✨

cmp_int β€” perform a three-way comparison of the arguments

like, it looks at two things and tells you who's bigger. that's the whole job. and it ate. πŸ”₯


πŸ¦‹ SYNOPSIS πŸ¦‹

cmp_int (l , r );

yes that's the whole call. no cap, she's compact. 🫢


🌸 ARGUMENTS 🌸

  • l β€” the left argument πŸ‘ˆ
  • r β€” the right argument πŸ‘‰

two arguments, one on the left, one on the right. we love a symmetrical setup. ✨


πŸ’– RETURN πŸ’–

three possible moods, and you're getting exactly one of them:

  • 1 if the left argument is greater than the right one πŸ”₯
  • 0 if the arguments are equal πŸŽ€
  • -1 if the left argument is less than the right one πŸ’€

it's literally the whole three-way comparison vibe. greater, equal, lesser β€” the holy trinity. periodt. πŸ‘‘

ngl, keep these exact values in mind: 1, 0, -1. don't go inventing new numbers, bestie, the kernel will not be amused 😭

🌈 SEE ALSO 🌈

  • Kernel file ./include/linux/sort.h πŸ“ β€” go look, iykyk 🧚

and that's the page!! sending you off with the receipts: this one lives under ./include/linux, dated October 2026, and it's literally called cmp_int(9) β€” iconic, no notes πŸ’œβ­πŸ“

πŸ“¦ where this page comes from