errseq_check_and_advance(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ errseq_check_and_advance(9) ✨

okay so bestie, this is a page from the Kernel API Manual and honestly it's giving "tiny function, big responsibilities" πŸŽ€ we're looking at errseq_check_and_advance β€” the girl whose whole job is: check an errseq_t and advance it to the current value. lowkey iconic.


🌸 SYNOPSIS 🌸

int errseq_check_and_advance (errseq_t *eseq , errseq_t *since );

no cap, that's the whole signature. two pointers in, one int out 🫢


πŸ’… ARGUMENTS πŸ’…

  • eseq β€” pointer to the value being checked and reported. she's the one getting inspected πŸ‘€
  • since β€” pointer to a previously-sampled errseq_t that we check against and advance. so she's both the reference point AND the thing getting moved forward. main character energy fr fr ✨

πŸ¦‹ DESCRIPTION πŸ¦‹

So here's the vibe check πŸ” β€” we grab the eseq value and see whether it matches the value that since points to. If it does? Cute. We just return 0 and go about our day πŸ’–

But if it doesn't match, that means the value has changed 😭 so here's the plan:

  1. Set the "seen" flag.
  2. Try to swap it into place as the new eseq value.
  3. Then set that value as the new "since" value.
  4. And return whatever the error portion is set to.

like, she's a whole pipeline okay 🧚

⚠️ important caveat bestie, pay attention: no locking is provided here for concurrent updates to the "since" value. The caller has to provide that if necessary. no cap, that's on you πŸ™ˆ

And because of that, callers may want to do a lockless errseq_check before taking the lock and calling this. yes, that's a real strategy, not me being chaotic πŸ”₯


⭐ RETURN ⭐

Negative errno if one has been stored, or 0 if no new error has occurred. that's it, that's the return. short and slay πŸ’«


πŸŽ€ SEE ALSO πŸŽ€

Kernel file ./lib/errseq.c β€” and go say hi to her friends: errseq_set(9), errseq_sample(9), errseq_check(9) πŸ’œ


signing off from ./lib, dated October 2026 β€” stay locked, stay sampled, and remember to advance your errseqs responsibly πŸ‘‘πŸ’…

πŸ“¦ where this page comes from