bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bogus getaddrinfo(3) on Darwin 9.2.2


From: Paolo Bonzini
Subject: Re: Bogus getaddrinfo(3) on Darwin 9.2.2
Date: Wed, 17 Feb 2010 18:09:06 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.7) Gecko/20100120 Fedora/3.0.1-1.fc12 Lightning/1.0b2pre Thunderbird/3.0.1


int
main (int argc, char *argv[])
{
   int err;
   struct addrinfo *res, hints;

   memset (&hints, 0, sizeof (hints));
   err = getaddrinfo (NULL, "does-not-exist",&hints,&res);
   printf ("err = %i `%s'\n", err, gai_strerror (err));

   return err != 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
--8<---------------cut here---------------end--------------->8---

Here, I’d expect either ‘EAI_NONAME’ or ‘EAI_SERVICE’ (glibc 2.11
returns the latter on GNU/Linux).  On ‘i386-apple-darwin9.2.2’ it
succeeds:

   err = 0 `Unknown error'

My guess is that it’s a bug.  What do you think?

If it is indeed a bug, should we try to work around it in Gnulib?
Any idea how this could be done?

Out of curiosity, what does getservbyname("does-not-exist", NULL) return?

Paolo





reply via email to

[Prev in Thread] Current Thread [Next in Thread]