bug-gnulib
[Top][All Lists]
Advanced

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

Bogus getaddrinfo(3) on Darwin 9.2.2


From: Ludovic Courtès
Subject: Bogus getaddrinfo(3) on Darwin 9.2.2
Date: Tue, 16 Feb 2010 17:59:21 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Hello!

The getaddrinfo(3) function appears to have bogus behavior on
‘i386-apple-darwin9.2.2’ (Darwin 9.6 apparently doesn’t have the
problem).  Here’s the test program:

--8<---------------cut here---------------start------------->8---
#include <netdb.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

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?

Thanks,
Ludo’.




reply via email to

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