cmp_int(9)
π 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:
1if the left argument is greater than the right one π₯0if the arguments are equal π-1if 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
- 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