Let us extend the question to interfaces in a broader sense.
errno
:
technically it is not even clear what it is, a variable, a macro, an implicit function call? In practice on modern systems it is mostly a macro that transforms into a function call to have a thread specific error state. It is evil:
- because it may cause overhead for the
caller to access the value, to check the "error" (which might just be an exceptional event)
- because it even imposes at some places that the caller clears this "variable" before making a library call
- because it implements a simple error
return by setting a global state, of the library.
The forthcoming standard gets the definition of errno
a bit more straight, but these uglinesses remain