raw_atomic_l...add_negative(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… raw_atomic_long_add_negative(9) πŸ’…

okay so this is a page from the Kernel API Manual and honestly? it's a baddie. it's raw_atomic_long_add_negative, and no i will not be pronouncing the truncated version in the header, we're saying the whole thing. periodt.


✨ NAME ✨

raw_atomic_long_add_negative β€” the atomic add that ALSO tells you if the result came out negative, with full ordering. two jobs, one function, main character energy fr fr πŸŽ€


🌸 SYNOPSIS 🌸

bool raw_atomic_long_add_negative (long i , atomic_long_t *v );

like yes she returns a bool and yes she takes exactly those two things, no cap 🫢


πŸ¦‹ ARGUMENTS πŸ¦‹

  • i β€” the long value you're adding. that's it, that's the whole vibe.
  • v β€” a pointer to an atomic_long_t. this is the thing getting updated, bestie.

πŸ’– DESCRIPTION πŸ’–

so the way this works: she atomically updates v to (v + i), and she does it with full ordering. atomic girlie, fully ordered, no shortcuts. lowkey iconic 🌈

and the plot twist β€” she's safe to use in noinstr code. like she's allowed in the no-instrumentation zone. but listen: prefer atomic_long_add_negative everywhere else, okay? raw_ is the special-occasion one. iykyk πŸ’…


⭐ RETURN ⭐

  • true if the resulting value of v is negative πŸ‘‘
  • false otherwise πŸ“

that's it. that's the whole test. she adds, she checks, she reports back.


🧚 SEE ALSO 🧚

first up, the kernel file where she lives:

  • Kernel file ./include/linux/atomic/atomic-long.h

and now the whole entire friend group β€” every single one, in order, because we do not skip people in this house πŸ’œ

like look at that list. she has a LOT of siblings and they all ate πŸ”₯


and that's the page bestie 🫢 source is ./include/linux/atomic, dated October 2026, and the manual name is, once again, raw_atomic_l...add_negative(9) πŸ’– mwah, go add something negative ✨

πŸ“¦ where this page comes from