avr_errno(3avr)

πŸ’– avr_errno β€” the <errno.h> tea, aka System Errors ✨

okay bestie, pull up a chair because this is the page for avr_errno(3avr) and it's literally the "what went wrong tho" cheat sheet for AVR-LibC 🫢


🌸 SYNOPSIS 🌸

Macros

#define EDOM   33
#define ERANGE   34

Variables

int errno

✨ Detailed Description ✨

so first things first, you gotta

#include <errno.h>

Some functions in the library set the global variable errno when an error occurs. And <errno.h>? She's the one handing out symbolic names for all the various error codes. iconic behavior honestly πŸ’…


πŸŽ€ Macro Definition Documentation πŸŽ€

  • #define EDOM 33 β€” Domain error. that's it, that's the whole vibe.
  • #define ERANGE 34 β€” Range error. same energy, different number.

πŸ¦‹ Variable Documentation πŸ¦‹

int errno [extern]

Error code for last error encountered by library. The variable errno holds the last error code encountered by a library function.

⚠️ okay listen up bestie, this part is IMPORTANT: this variable must be cleared by the user prior to calling a library function. yes, YOU have to clear it. it does not clear itself. no cap. 😭
🚨 Warning The errno global variable is not safe to use in a threaded or multi-task system. A race condition can occur if a task is interrupted between the call which sets error and when the task examines errno. If another task changes errno during this time, the result will be incorrect for the interrupted task. it's giving "shared global variable betrayal" and honestly it will not hesitate to lie to you πŸ’€

πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for AVR-LibC from the source code. so yeah, the bots wrote it. slay, I guess 🌈


aaaand that's the whole page, bestie πŸ’œ this was AVR-LibC Version 2.2.1, dated the avr_errno(3avr) era β€” thanks for reading all the way to the bottom, you're a real one πŸ«Άβœ¨πŸŽ€

πŸ“¦ where this page comes from