Re: Registry of known foreign error collections Lassi Kortela 27 Jul 2020 12:46 UTC

> Aren’t there also the netdb error codes:
>
> SYNOPSIS
>       #include <netdb.h>
>
>       int h_errno;
>
>       [...]
>       void
>       herror(const char *string);
>
>       const char *
>       hstrerror(int err);

Good point.

POSIX also has `const char *gai_strerror(int)` where "gai" stands for
getaddrinfo and friends.

herror() and hstrerror() are not mentioned in POSIX, and "The
obsolescent h_errno external integer [is removed]".

<https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/netdb.h.html>
lists the following errors. Apparently they are passed to the caller as
return values from netdb functions. They also used to be stored in
`h_errno` but POSIX dropped that.

EAI_AGAIN
EAI_BADFLAGS
EAI_FAIL
EAI_FAMILY
EAI_MEMORY
EAI_NONAME
EAI_SERVICE
EAI_SOCKTYPE
EAI_SYSTEM
EAI_OVERFLOW

The error sets we have so far:

'errno        C/POSIX/Unix errno values
'ftp          File Transfer Protocol reply codes
'http         Hypertext Transfer Protocol status codes
'libsodium    The libsodium cryptography library
'mysql        MySQL and MariaDB database errors
'netdb        POSIX/Unix netdb.h error values
'postgresql   PostgreSQL errors
'sqlite       SQLite database result codes
'windows      Microsoft Windows API (aka win32)
'winsock      Microsoft Windows Sockets API