swap(9)
π swap(9) β the Kernel API Manual glow-up π«Ά
okay so bestie, welcome to the Kernel API Manual page for swap β¨ it's a tiny one, but it's lowkey iconic β a whole little function whose entire personality is "you give me two things, I flip them." no cap. π¦
πΈ NAME πΈ
swap β literally swaps the values of @a and @b. that's it. that's the whole gig. π
β¨ SYNOPSIS β¨
swap (a , b );
look at her. two args, zero drama. π
π§ ARGUMENTS π§
aβ the first value π like, the value that starts out on the left, living its best lifebβ the second value π the other one. afterswapdoes her thing, they've traded places fr fr
ngl the whole point is that @a and @b end up holding each other's values β no extra steps, no notes. π
π₯ SEE ALSO π₯
the whole min/max friend group is here and they're all in ./include/linux/minmax.h β go say hi to the rest of the squad:
min(9)max(9)umin(9)umax(9)min3(9)max3(9)min_t(9)max_t(9)min_not_zero(9)clamp(9)clamp_t(9)clamp_val(9)min_array(9)max_array(9)in_range(9)
literally the most supportive little header file in the kernel, iykyk ππ
π cute sign-off time: this page comes from./include/linux, dated October 2026, and it's filed underswap(9)β and yes, that's the whole manual page, she's smol but she ate. periodt. πβ¨
π¦ 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