upvote
OpenBSD up to 5.9 had errno(2) symlinked to intro(2), describing error codes:

https://man.freebsd.org/cgi/man.cgi?query=errno&apropos=0&se...

Also, your statements about the kernel and libc are OS specific.

reply
Why does libc do this instead of simply returning that same negative number?
reply
Legacy. It's always been this way and it can't change without breaking everything.
reply
POSIX, basically. It was already a convention by the time linux/glibc implemented it.
reply
deleted
reply