raw_atomic64...ess_negative(9)
πΈ raw_atomic64...ess_negative(9) β Kernel API Manual, bestie edition π
okay so this is a page straight out of the Kernel API Manual, and the title got a little β¨truncatedβ¨ on the way in β the header literally reads raw_atomic64...ess_negative(9) up top, which is giving "name too long for the man page column, so we did a little snip snip". Iconic behavior honestly. Anyway, it's the man page for raw_atomic64_inc_unless_negative, and she is so much more chill than she sounds π«Ά
π¦ NAME
raw_atomic64_inc_unless_negative β atomic increment unless negative, with full ordering. That's the whole vibe: bump the number, but only if it's not already in the negatives. Manifesting the +1 β¨
π SYNOPSIS
bool raw_atomic64_inc_unless_negative (atomic64_t *v );
that's it. one function, one pointer, one bool coming back to you. lowkey elegant π
π§ ARGUMENTS
vβ pointer to anatomic64_t. like, that's your little number box. hand her over, she knows what to do πΈ
β DESCRIPTION
So here's the tea, bestie: if (v >= 0), she atomically updates v to (v + 1) with full ordering. Full ordering, no cap β that's the strong memory-barrier energy π₯
Otherwise β meaning if v is negative β v is not modified at all, and relaxed ordering is provided. She looks at it, goes "nope, not today", and does nothing. Respect. π
also super important: it's safe to use innoinstrcode β that's literally her whole thing. But everywhere else? Preferatomic64_inc_unless_negative. She's the specialist, not the default. iykyk π§ββοΈ
π RETURN
trueβvwas updated (she said yes π)falseβvwas not updated (she said no π)
π SEE ALSO
okay so the source file for all this lives right here:
./include/linux/atomic/atomic-arch-fallback.hin the kernel tree
and then there's the entire friend group β every single one of these is a real reference, and yes I'm listing all of them, because we don't gatekeep on this blog π
the 32-bit raw_atomic_* babes β¨
- read / set β
raw_atomic_read(9),raw_atomic_read_acquire(9),raw_atomic_set(9),raw_atomic_set_release(9) - add β
raw_atomic_add(9),raw_atomic_add_return(9),raw_atomic_add_return_acquire(9),raw_atomic_add_return_release(9),raw_atomic_add_return_relaxed(9),raw_atomic_fetch_add(9),raw_atomic_fetch_add_acquire(9),raw_atomic_fetch_add_release(9),raw_atomic_fetch_add_relaxed(9) - sub β
raw_atomic_sub(9),raw_atomic_sub_return(9),raw_atomic_sub_return_acquire(9),raw_atomic_sub_return_release(9),raw_atomic_sub_return_relaxed(9),raw_atomic_fetch_sub(9),raw_atomic_fetch_sub_acquire(9),raw_atomic_fetch_sub_release(9),raw_atomic_fetch_sub_relaxed(9) - inc β
raw_atomic_inc(9),raw_atomic_inc_return(9),raw_atomic_inc_return_acquire(9),raw_atomic_inc_return_release(9),raw_atomic_inc_return_relaxed(9),raw_atomic_fetch_inc(9),raw_atomic_fetch_inc_acquire(9),raw_atomic_fetch_inc_release(9),raw_atomic_fetch_inc_relaxed(9) - dec β
raw_atomic_dec(9),raw_atomic_dec_return(9),raw_atomic_dec_return_acquire(9),raw_atomic_dec_return_release(9),raw_atomic_dec_return_relaxed(9),raw_atomic_fetch_dec(9),raw_atomic_fetch_dec_acquire(9),raw_atomic_fetch_dec_release(9),raw_atomic_fetch_dec_relaxed(9) - and β
raw_atomic_and(9),raw_atomic_fetch_and(9),raw_atomic_fetch_and_acquire(9),raw_atomic_fetch_and_release(9),raw_atomic_fetch_and_relaxed(9) - andnot β
raw_atomic_andnot(9),raw_atomic_fetch_andnot(9),raw_atomic_fetch_andnot_acquire(9),raw_atomic_fetch_andnot_release(9),raw_atomic_fetch_andnot_relaxed(9) - or β
raw_atomic_or(9),raw_atomic_fetch_or(9),raw_atomic_fetch_or_acquire(9),raw_atomic_fetch_or_release(9),raw_atomic_fetch_or_relaxed(9) - xor β
raw_atomic_xor(9),raw_atomic_fetch_xor(9),raw_atomic_fetch_xor_acquire(9),raw_atomic_fetch_xor_release(9),raw_atomic_fetch_xor_relaxed(9) - xchg β
raw_atomic_xchg(9),raw_atomic_xchg_acquire(9),raw_atomic_xchg_release(9),raw_atomic_xchg_relaxed(9) - cmpxchg β
raw_atomic_cmpxchg(9),raw_atomic_cmpxchg_acquire(9),raw_atomic_cmpxchg_release(9),raw_atomic_cmpxchg_relaxed(9) - try_cmpxchg β
raw_atomic_try_cmpxchg(9),raw_atomic_try_cmpxchg_acquire(9),raw_atomic_try_cmpxchg_release(9),raw_atomic_try_cmpxchg_relaxed(9) - the test girlies β
raw_atomic_sub_and_test(9),raw_atomic_dec_and_test(9),raw_atomic_inc_and_test(9),raw_atomic_add_negative(9),raw_atomic_add_negative_acquire(9),raw_atomic_add_negative_release(9),raw_atomic_add_negative_relaxed(9) - the unless / not_zero clique β
raw_atomic_fetch_add_unless(9),raw_atomic_add_unless(9),raw_atomic_inc_not_zero(9),raw_atomic_inc_unless_negative(9),raw_atomic_dec_unless_positive(9),raw_atomic_dec_if_positive(9)
and the 64-bit raw_atomic64_* main characters π
- read / set β
raw_atomic64_read(9),raw_atomic64_read_acquire(9),raw_atomic64_set(9),raw_atomic64_set_release(9) - add β
raw_atomic64_add(9),raw_atomic64_add_return(9),raw_atomic64_add_return_acquire(9),raw_atomic64_add_return_release(9),raw_atomic64_add_return_relaxed(9),raw_atomic64_fetch_add(9),raw_atomic64_fetch_add_acquire(9),raw_atomic64_fetch_add_release(9),raw_atomic64_fetch_add_relaxed(9) - sub β
raw_atomic64_sub(9),raw_atomic64_sub_return(9),raw_atomic64_sub_return_acquire(9),raw_atomic64_sub_return_release(9),raw_atomic64_sub_return_relaxed(9),raw_atomic64_fetch_sub(9),raw_atomic64_fetch_sub_acquire(9),raw_atomic64_fetch_sub_release(9),raw_atomic64_fetch_sub_relaxed(9) - inc β
raw_atomic64_inc(9),raw_atomic64_inc_return(9),raw_atomic64_inc_return_acquire(9),raw_atomic64_inc_return_release(9),raw_atomic64_inc_return_relaxed(9),raw_atomic64_fetch_inc(9),raw_atomic64_fetch_inc_acquire(9),raw_atomic64_fetch_inc_release(9),raw_atomic64_fetch_inc_relaxed(9) - dec β
raw_atomic64_dec(9),raw_atomic64_dec_return(9),raw_atomic64_dec_return_acquire(9),raw_atomic64_dec_return_release(9),raw_atomic64_dec_return_relaxed(9),raw_atomic64_fetch_dec(9),raw_atomic64_fetch_dec_acquire(9),raw_atomic64_fetch_dec_release(9),raw_atomic64_fetch_dec_relaxed(9) - and β
raw_atomic64_and(9),raw_atomic64_fetch_and(9),raw_atomic64_fetch_and_acquire(9),raw_atomic64_fetch_and_release(9),raw_atomic64_fetch_and_relaxed(9) - andnot β
raw_atomic64_andnot(9),raw_atomic64_fetch_andnot(9),raw_atomic64_fetch_andnot_acquire(9),raw_atomic64_fetch_andnot_release(9),raw_atomic64_fetch_andnot_relaxed(9) - or β
raw_atomic64_or(9),raw_atomic64_fetch_or(9),raw_atomic64_fetch_or_acquire(9),raw_atomic64_fetch_or_release(9),raw_atomic64_fetch_or_relaxed(9) - xor β
raw_atomic64_xor(9),raw_atomic64_fetch_xor(9),raw_atomic64_fetch_xor_acquire(9),raw_atomic64_fetch_xor_release(9),raw_atomic64_fetch_xor_relaxed(9) - xchg β
raw_atomic64_xchg(9),raw_atomic64_xchg_acquire(9),raw_atomic64_xchg_release(9),raw_atomic64_xchg_relaxed(9) - cmpxchg β
raw_atomic64_cmpxchg(9),raw_atomic64_cmpxchg_acquire(9),raw_atomic64_cmpxchg_release(9),raw_atomic64_cmpxchg_relaxed(9) - try_cmpxchg β
raw_atomic64_try_cmpxchg(9),raw_atomic64_try_cmpxchg_acquire(9),raw_atomic64_try_cmpxchg_release(9),raw_atomic64_try_cmpxchg_relaxed(9) - the test girlies, 64-bit remix β
raw_atomic64_sub_and_test(9),raw_atomic64_dec_and_test(9),raw_atomic64_inc_and_test(9),raw_atomic64_add_negative(9),raw_atomic64_add_negative_acquire(9),raw_atomic64_add_negative_release(9),raw_atomic64_add_negative_relaxed(9) - the unless / not_zero clique, 64-bit remix β
raw_atomic64_fetch_add_unless(9),raw_atomic64_add_unless(9),raw_atomic64_inc_not_zero(9),raw_atomic64_dec_unless_positive(9),raw_atomic64_dec_if_positive(9)
and that's the whole page, bestie!! π this one came from the source path ./include/linux/atomic and it's dated October 2026 β so mark your calendar, she's a Scorpio I guess π¦β¨ mwah, go forth and increment responsibly π«Άπ
π¦ 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