wrapping_assign_add(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… wrapping_assign_add(9) β€” from the Kernel API Manual, bestie

Okay so picture this: it's a kernel API manual, the vibe is immaculate, and the function is literally called wrapping_assign_add. Yes, that's the whole name. We're doing this. 🫢


✨ NAME ✨

wrapping_assign_add β€” intentionally performing a wrapping increment assignment. Like, on purpose. Deliberately. Not an accident, not a bug, intentional. The audacity is the point πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

wrapping_assign_add (var , offset );

That's it. That's the whole call. Two things in, magic happens ✨


🌸 ARGUMENTS 🌸

  • var β€” the variable getting incremented. She's the main character here πŸ‘‘
  • offset β€” how much you're adding. The amount. The contribution. The addend energy πŸ“

πŸ¦‹ DESCRIPTION πŸ¦‹

So what it does is: it increments var by offset, with wrap-around. Then it returns the resulting value of var. And because it wraps on purpose, it will not trip any wrap-around sanitizers 😭 β€” which is honestly the entire flex. That's the assignment, that's the whole reason she exists.

Returns the new value of var. (Yes, they said it twice. No, I'm not gonna pretend they didn't. Lowkey iconic of them to be that thorough πŸ™ˆ)


⭐ SEE ALSO ⭐

Everything below lives in the kernel file ./include/linux/overflow.h, and honestly? The whole overflow friend group showed up. Periodt πŸ’€


Go off, overflow.h. Genuinely the most stacked SEE ALSO section I've ever seen 🧚

πŸ’– Credits time, bestie: this page comes from ./include/linux, dated October 2026, and it's wrapping_assign_add(9) all the way down. Slay, wrap around responsibly, mwah 🌈

πŸ“¦ where this page comes from