sys/tiny_strerror: add tiny `strerror()` implementation
Contribution description
tiny_strerror() is a drop-in replacement for strerror(), but instead of a long help message it returns the much shorter macro name matching the given number.
The (pseudo-)module tiny_strerror_as_strerror can be used to replace all calls to strerror() with calls to tiny_strerror().
This new module is directly put to use:
- The custom AVR8
strerror()implementation is dropped and replaced bytiny_strerror_as_strerror - The
vfsshell command used another customstrerror()implementation, which is also replaced
Testing procedure
The vfs shell command should still provide sensible error output and AVR8 builds that use strerror() should still succeed.
Issues/PRs references
None
Anything still needed here?
Please squash!
:+1: This will also be very helpful for testing, as clibs tend to use there own string (or even worse: having native running with a e.g. a de locale). Having a deterministic string output greatly improves things!
Note that sadly it will not be fully deterministic, as EGAIN and EWOULDBLOCK may or may not have different numeric values. And on Linux, even ENOTSUP and EOPNOTSUPP have the same numeric value, but the man page says
EOPNOTSUPP Operation not supported on socket (POSIX.1-2001). (ENOTSUP and EOPNOTSUPP have the same value on Linux, but according to POSIX.1 these error values should be distinct.)
But it will indeed be much more predictable.
as EGAIN and EWOULDBLOCK may or may not have different numeric values
Different numeric numbers are not a problem. That can very easily handled with a regular expression. Having to look out for completely different strings based on trial-and-error is a whole other beast ;-)
CI is now happy :)