logoalt Hacker News

aaronmdjonestoday at 2:08 PM3 repliesview on HN

`errno` is a userland concept; the kernel returns negative error numbers that libc then turns into -1 and sets errno. Thus the correct manpage is errno(3).


Replies

eqvinoxtoday at 3:10 PM

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.

WhyNotHugotoday at 5:24 PM

Why does libc do this instead of simply returning that same negative number?

show 2 replies