errseq_set(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– errseq_set(9) β€” like, the kernel API manual, but make it make sense ✨

Hey bestie!! So this is from the Kernel API Manual (yes, that manual, the big serious one) and today's main character is errseq_set. Buckle up, it's short but it eats. 🫢


🌸 NAME 🌸

errseq_set β€” set a errseq_t for later reporting πŸ’…

⭐ SYNOPSIS ⭐

errseq_t errseq_set (errseq_t *eseq , int err );

Like, that's the whole vibe. Two args, one return, no drama. πŸŽ€

πŸ¦‹ ARGUMENTS πŸ¦‹

  • eseq β€” the errseq_t field that should be set. This is the lil guy getting the update, okay? πŸ‘‘
  • err β€” the error to set, and it must be between -1 and -MAX_ERRNO. Not negotiable, bestie, that's the range. 🚨

πŸ’œ DESCRIPTION πŸ’œ

okay so here's what happens: this function sets the error in eseq, and it increments the sequence counter if the last sequence was sampled at some point in the past. That's the whole trick. ✨

And the golden rule β€” any error set will always overwrite an existing error. No merging, no "but what about the old one", it's giving replace-and-move-on. πŸ’…

🌈 RETURN 🌈

It hands back the previous value, which is primarily for debugging purposes. Like, cute for snooping, that's it. πŸ™ˆ

⚠️ Do not use the return value as a previously sampled value in later calls β€” it will not have the SEEN flag set. For real, don't do it. 😭

πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./lib/errseq.c β€” that's where the magic lives, iykyk β€” plus errseq_sample(9), errseq_check(9), and errseq_check_and_advance(9). The whole friend group fr fr. 🧚


And that's the page!! Shoutout to ./lib for the source and October 2026 for the date β€” slay, iconic, periodt. πŸ’€πŸŒΈβ­

πŸ“¦ where this page comes from