errno in C?
You may see references to
errno in C code. This is defined in
#define errno (*__error())
errno dereferences a call to a function
__error. This is defined as
extern int * __error(void);
That is, a function which takes no arguments and returns a non-null pointer to the error number.
The docs say
errnois defined by the ISO C standard to be a modifiable lvalue of type
That is, we should be able to assign to
errno. This is possible, because
*V is also an lvalue.
These details aside,
errno is basically a global
int value. Its value is set by some system calls. It’s an assistant to the “return
More by Jim
- Your syntax highlighter is wrong
- Granddad died today
- The Three Ts of Time, Thought and Typing: measuring cost on the web
- I hate telephones
- The sorry state of OpenSSL usability
- The dots do matter: how to scam a Gmail user
- My parents are Flat-Earthers
- How Hacker News stays interesting
- Project C-43: the lost origins of asymmetric crypto
- The hacker hype cycle
- The inception bar: a new phishing method
- Time is running out to catch COVID-19
- A probabilistic pub quiz for nerds
- Smear phishing: a new Android vulnerability
Tagged . All content copyright James Fisher 2016. This post is not associated with my employer. Found an error? Edit this page.