raw_atomic_l...tive_relaxed(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ NAME ✨

raw_atomic_long_add_negative_relaxed β€” atomic add and test if negative with relaxed ordering. That’s the function, bestie, and she’s literally doing exactly what it says on the tin πŸ’…


πŸ› οΈ SYNOPSIS πŸ› οΈ

okay so the whole call looks like this, character for character:

bool raw_atomic_long_add_negative_relaxed (long i , atomic_long_t *v );

πŸŽ€ ARGUMENTS πŸŽ€

two little params, no cap:

  • i β€” long value to add. this is the number you’re adding in, and yes she’s a long.
  • v β€” pointer to atomic_long_t. this is the atomic long you’re updating, passed as a pointer 🫢

πŸ’… DESCRIPTION πŸ’…

okay so the actual behavior: it atomically updates v to (v + i) with relaxed ordering. that’s the whole plot, fr fr πŸ’–

also, important caveat bestie: this one is safe to use in noinstr code. everywhere else, prefer atomic_long_add_negative_relaxed β€” like, she’s the one you want in normal-land. no cap ✨


πŸ”₯ RETURN πŸ”₯

it returns true if the resulting value of v is negative, and false otherwise. so you get your little β€œdid this end up negative?” answer. iconic πŸ”₯


πŸ‘€ SEE ALSO πŸ‘€

the atomic-long extended universe, no skips, fr fr:


source/version: ./include/linux/atomic; date: October 2026; page: raw_atomic_l...tive_relaxed(9). byeee, go add some longs and test if they’re negative πŸ’–πŸ«Άβœ¨

πŸ“¦ where this page comes from