Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!ut-emx!mic From: mic@ut-emx.UUCP (Mic (... K[a-z]+) Kaczmarczik) Newsgroups: comp.windows.x Subject: Re: X11R2/SunOS 3.2 + gethostbyname? Summary: check netdb.h vs. library you get gethostbyname() from Message-ID: <7153@ut-emx.UUCP> Date: 21 Oct 88 22:39:38 GMT References: <1574@cayman.COM> Reply-To: mic@emx.UUCP (Mic Kaczmarczik) Organization: UT Austin Computation Center, User Services Unix Support Group Lines: 36 In article <1574@cayman.COM> brad@cayman.COM (Brad Parker) writes: >Perhaps I am half a step behind the rest of the world; I was unable to >get X11R2 clients built with SunOS 3.2 to work on anything but local (unix) >sockets. They would crash in bcopy() from XConnectDisplay() if environment >variable DISPLAY was set or "-display xxx:0" was used. > >I tracked it down to what looks like abberhent behavior of gethostbyname() >on Sun's. They seem to return a unsigned long IP address where other machines >return a ptr to the same. (struct hostent *)->h_addr I don't know if this is exactly Brad's situation, but we had the same sort of problem when we installed the Berkeley name server software on our Suns, then later rebuilt the X library. The clients all core dumped just as Brad describes above, and we traced it to the version of netdb.h we had installed as part of the nameserver installation. I'd check your version of netdb.h to see if it treats the h_addr field in a hostent struct as a char * (SunOS 3.4, static host table lookup) or a char ** (4.3 BSD, BIND name server). The netdb.h you use to compile the clients with has to match the library you get gethostbyname() from: if you just link against the SunOS libc.a, you need the char * version, whereas if you see h_addr defined as a char **, you can probably add -lresolv to the SYSAUX_LIBRARIES line in the standard Makefiles and relink everything to get the newer gethostbyname(). We chose to back down from the name server until we had time to install BIND 4.8 (we were using 4.5 and having problems), so we re-installed the old netdb.h, rebuilt XConnectDisplay, relinked the clients, and they worked fine. --mic-- -- Mic Kaczmarczik If you drink, don't drill. UT Austin Computation Center -- Matt Groening mic@emx.utexas.edu MIC@UTAIVC.BITNET