errseq_check_and_advance(9)
β¨ 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-samplederrseq_tthat 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:
- Set the
"seen"flag. - Try to swap it into place as the new
eseqvalue. - Then set that value as the new
"since"value. - 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
- 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