On Tue, 24 Aug 2021 at 16:36, Niall Douglas via Boost-users
wrote: On 24/08/2021 13:57, Nils Frielinghaus via Boost-users wrote:
What can be easily demonstrated though, is, that the translate_addrinfo_error function converts EAI_SYSTEM with errno=0 (which is triggered by the above set-up) into a Boost error code that shows success. So this program will output "Success".
This is a long standing design quirk of error_code which we have fixed in proposed status_code, which is hoped to supersede error_code in a future C++ standard.
I think you are talking about a different problem. The issue here is that https://pubs.opengroup.org/onlinepubs/9699919799/functions/getaddrinfo.html says "[EAI_SYSTEM] A system error occurred; the error code can be found in errno." and apparently there is a implementation not honouring this contract. This is happening way before there is any error_code.
Earlier in the cited document https://pubs.opengroup.org/onlinepubs/9699919799/functions/getaddrinfo.html it reads "A zero return value for getaddrinfo() indicates successful completion; a non-zero return value indicates failure." This suggests to me that it is not correct to consider the return value EAI_SYSTEM with errno = 0 as a successful return value and that it would be better to handle this as a system error with unidentified cause.