Live data from Hacker News

AI errno(2) values

netmeister.org

11–20 of 22 posts

Re: AI errno(2) values

#14
As a long time emacs user, I appreciated the inclusion of EMACS as an error code. When I moved from TECO to gnu emacs in to 80s, elisp was an advance. Now I have a perpetual todo item... "rewrite emacs in fennel or janet or even minimalisp."

"What was deluxe is now debris..."

Re: AI errno(2) values

#15

`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).

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.

Re: AI errno(2) values

#18

`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).

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

POSIX, basically. It was already a convention by the time linux/glibc implemented it.

Re: AI errno(2) values

#20

`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).

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

Legacy. It's always been this way and it can't change without breaking everything.
Post reply on HN