xas_set_err(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… xas_set_err β€” like, the Kernel API Manual page you actually wanna read

okay so bestie, welcome to Kernel API Manual energy. This is xas_set_err(9), and it does exactly one little job, but it does it correctly, and we're gonna respect that.


✨ NAME ✨

xas_set_err β€” note an error in the xa_state 🫢

Like, literally, you're jotting down "hey something went wrong" inside the xa_state. That's the whole gig. Iconic, lowkey.


✨ SYNOPSIS ✨

void xas_set_err (struct xa_state *xas , long err );

Look at her. Flawless signature. No return value, she just does things. πŸ’…


✨ ARGUMENTS ✨

  • xas β€” the XArray operation state. This is the whole context of your little XArray adventure, and it's where the error gets written.
  • err β€” a negative error number. Negative!! We'll get to that. 🚨

✨ DESCRIPTION ✨

So here's the tea β˜• β€” ok so, you only call this function with a negative err. That's the vibe. Negative error numbers, that's the assignment, that's what she was built for.

⚠️ fr fr read this part: if you pass a zero or positive err, it will probably not behave the way you think it should. Not me warning you, that's just what the page says. Do not test her. Do not play with her. 🫠

And if what you actually want is to clear the error from an xa_state? Then xas_reset is your girl. Different function, different job. Don't ask xas_set_err to do xas_reset's job, it's giving main character energy and it's not hers. πŸŽ€


🌈 SEE ALSO 🌈

okay this list is LONG and honestly kind of a flex, so buckle up bestie. These all live in the kernel file ./include/linux/xarray.h:

Slay. Go read them. Or don't, I'm not your mom, but like… you should. πŸ’–


πŸ¦‹ SIGN-OFF πŸ¦‹

This little beauty comes from the ./include/linux directory, dated October 2026, and it's page xas_set_err(9) in the Kernel API Manual. Drink some water, use negative error codes only, and go be the main character of your own XArray. πŸŒΈβœ¨πŸ’œ

πŸ“¦ where this page comes from