From: fritz@scipp.UCSC.EDU (Frederick Staats)
Newsgroups: comp.unix.aix
Subject: Re: X11R5 clients on AIX3.2 X11R4 server
Keywords: X11
Date: 6 Apr 92 18:37:04 GMT
Article-I.D.: darkstar.32178
Organization: Santa Cruz Institute for Particle Physics

In article <1992Apr6.164238.26975@boingo.med.jhu.edu> derek@boingo.med.jhu.edu (Derek Ney) writes:
>I built the X11R5 clients on an RS6000/530 which
>we just upgraded to AIX 3.2. For some reason the 
>X11R5 clients (such as xterm) cannot connect to
>the X11R4 ibm server unless I use the -display hostname:0
>option to each program. It seems that clients by default
>use the -display :0 or -display unix:0 connection.
>Does anyone have any idea of why this is happening. Is
>there some R5->R4 backwards compatiblity option available
>when compiling R5? I am assuming that using the
>-display hostname:0 option would cause the clients to
>display slower because it is using a tcp/ip connection
>protocol. Please respond via e-mail.
>
>Thanks, Derek Ney
>derek@boingo.med.jhu.edu

AIX 3.2 uses BSD 4.4 TCP/IP code.  The binary interface is the
same but some minor changes are needed at the source level (I have
run into this with X11R5 and the monitor 1.5.1 program.

Here is a patch that I got from somone over the net:


Source size before building ~90 MBytes.


From root Thu Mar 12 08:05:50 1992
Received: from INTELLICORP.COM by scipp.UCSC.EDU (AIX 3.1/UCB 5.61/4.03)
          id AA28328; Thu, 12 Mar 92 08:05:48 -0800
Message-Id: <9203121605.AA28328@scipp.UCSC.EDU>
Date: Thu, 12 Mar 92 08:02:28 PST
From: Minh Tran-Le <TRANLE@INTELLICORP.COM>
Subject: Re: Building X11R5pl9 under AIX 3.2... UNIXCONN problems...
To: fritz@scipp.UCSC.EDU
Cc: xpert@expo.lcs.mit.edu
Reply-To: tranle@intellicorp.com
Status: RO

|Well the X11R5 builds under AIX 3.2 without problem.  However the the
|clients and server do not seem to be able to use the unix sockets
|connections but TCP/IP connections work.  I am using the same sources
|I used to build under AIX 3.1.
|
|xinit gets a "waiting for X server to begin acceptin connections."
|and waits forever.
|
|xclock X11R5 client under the X11R4 server:
|
|	xclock gets a "Error: Can't open display: unix:0"
|
|	DISPLAY=hostname:0 xclock works.
|
|I'm going to look into it farther but I don't really know where
|to start.  Any suggestions?
|

Well, IBM did some incompatible source level change in the sockaddr
structure they added one more field `sun_len' at the beginning of the
structure.  It is still binary compatible with the library compiled
uner aix 3.1 but not source compatible.

I just send out a bug report to xbugs.  Here is the changes that you 
need have. I have not any clean way to conditionalize it only for aix3.2.

Minh Tran-Le.

---------------------------------------------------------------------------
*** XConnDis.c-	Fri Sep 13 18:20:28 1991
--- XConnDis.c	Wed Mar 11 11:29:51 1992
***************
*** 442,450 ****
  
      unaddr.sun_family = AF_UNIX;
      sprintf (unaddr.sun_path, "%s%d", X_UNIX_PATH, idisplay);
  
      addr = (struct sockaddr *) &unaddr;
!     addrlen = strlen(unaddr.sun_path) + sizeof(unaddr.sun_family);
  
  #ifdef hpux /* this is disgusting */
      ounaddr.sun_family = AF_UNIX;
--- 442,451 ----
  
      unaddr.sun_family = AF_UNIX;
      sprintf (unaddr.sun_path, "%s%d", X_UNIX_PATH, idisplay);
+     unaddr.sun_len = strlen(unaddr.sun_path);
  
      addr = (struct sockaddr *) &unaddr;
!     addrlen = (sizeof(unaddr) - sizeof(unaddr.sun_path) + unaddr.sun_len);
  
  #ifdef hpux /* this is disgusting */
      ounaddr.sun_family = AF_UNIX;
-------


-- 
Frederick Staats
fritz@scipp.UCSC.EDU -- (408) 459-3575
Santa Cruz Institute for Particle Physics
University of California at Santa Cruz