emacs-devel
[Top][All Lists]
Advanced

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

Re: emacs server with X11 build on OSX


From: YAMAMOTO Mitsuharu
Subject: Re: emacs server with X11 build on OSX
Date: Wed, 04 Aug 2010 09:52:23 +0900
User-agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (Shijō) APEL/10.6 Emacs/22.3 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI)

>>>>> On Tue, 3 Aug 2010 15:03:08 +0200, Juanma Barranquero <address@hidden> 
>>>>> said:

> On Tue, Aug 3, 2010 at 15:01, Andreas Schwab <address@hidden>
> wrote:
>> gethostbyname works quite different from getaddrinfo.

> Still a problem that (make-network-process ... :host 'local) fails.
> Something's obviously not right.

I suspect there is a bug in getaddrinfo on Mac OS X 10.6.4.  At least,
the behavior of the following program is incompatible with that on Mac
OS X 10.5.8.

#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>

main ()
{
  struct addrinfo hints, *res;
  char *servnames[] = {"0", "1", NULL};
  int error, i;

  memset (&hints, 0, sizeof (hints));
  hints.ai_family = PF_UNSPEC;
  hints.ai_socktype = SOCK_STREAM;
  for (i = 0; i < sizeof (servnames) / sizeof (servnames[0]); i++)
    {
      if (servnames[i])
        printf ("servname = \"%s\":\n", servnames[i]);
      else
        printf ("servname = (null):\n");
      error = getaddrinfo ("localhost", servnames[i], &hints, &res);
      if (error != 0)
        puts (gai_strerror (error));
      else
        {
          struct addrinfo *r;

          for (r = res; r; r = r->ai_next)
            {
              printf ("family = %d, socktype = %d, protocol = %d\n",
                      r->ai_family, r->ai_socktype, r->ai_protocol);
            }
          freeaddrinfo (res);
        }
      puts ("");
    }
}

*** Mac OS X 10.6.4 ***
servname = "0":
nodename nor servname provided, or not known

servname = "1":
family = 30, socktype = 1, protocol = 6
family = 30, socktype = 1, protocol = 6
family = 2, socktype = 1, protocol = 6

servname = (null):
family = 30, socktype = 1, protocol = 6
family = 30, socktype = 1, protocol = 6
family = 2, socktype = 1, protocol = 6


*** Mac OS X 10.5.8 ***
servname = "0":
family = 30, socktype = 1, protocol = 6
family = 30, socktype = 1, protocol = 6
family = 2, socktype = 1, protocol = 6

servname = "1":
family = 30, socktype = 1, protocol = 6
family = 30, socktype = 1, protocol = 6
family = 2, socktype = 1, protocol = 6

servname = (null):
family = 30, socktype = 1, protocol = 6
family = 30, socktype = 1, protocol = 6
family = 2, socktype = 1, protocol = 6


Actually, one can find a major rewrite in getaddrinfo's
implementation.  (Libinfo in
http://opensource.apple.com/release/mac-os-x-1064/ and
http://opensource.apple.com/release/mac-os-x-1058/ )

                                     YAMAMOTO Mitsuharu
                                address@hidden



reply via email to

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