Boost logo

Boost Users :

From: Nils Frielinghaus (nils.frielinghaus_at_[hidden])
Date: 2021-08-25 14:23:38


> On Tue, 24 Aug 2021 at 16:36, Niall Douglas via Boost-users <boost-users_at_[hidden]> 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.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net