Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!corton!inria!axis-design!adesign!jcc From: jcc@adesign.uucp (Jean-Christophe Collet) Newsgroups: comp.windows.x Subject: Re: XPending fails on SCO (within GNU Emacs) Message-ID: Date: 13 Feb 91 09:10:05 GMT References: Sender: jcc@axis-design.fr (Jean-Christophe Collet) Distribution: comp Organization: Axis Design 119 rue de Flandre, 75019 Paris, France Lines: 63 In-Reply-To: jtsillas@bubba.ma30.bull.com's message of 11 Feb 91 20:18:20 GMT >I am in the process of building GNU Emacs to use the X11 facilities >on SCO Unix. Testing showed that things worked well if the server and client >were both running on the same machine but a remote server would fail with the >error: > Fatal X-windows I/O error: Invalid argument > >Using gdb, I tracked the failure to a call to XPending (XXdisplay) in >x11term.h. Is anyone aware of any problems with interrupt driven I/O >using SCO or with SCO's implementation of Xlib? The same code runs without >complication on a number of platforms. Well I figured out this one recently. The answer is in x11term.c, function x_init_1() [around line 1900] : static void x_init_1 () { #ifdef F_SETOWN extern int old_fcntl_owner; #endif dup2 (ConnectionNumber(XXdisplay), 0); close (ConnectionNumber(XXdisplay)); ConnectionNumber(XXdisplay) = 0; /* Looks a little strange? * check the def of the macro; * it is a genuine lvalue */ ... } Those two F*G lines after the dup2 are changing the internal Display structure (fd field to be precise). This is a kludge that doesn't work when the fd was the result of a t_open() [tli call]. And SCO uses tli for TCP/IP connections. Solution : Comment out the two lines (the close and the assignation). This worked for me. Beware : I don't know what version of SCO you're using (poor guy, I just hate when I have to work with such a shitty OS), but the XPending() function was buggy in the SCO Xlib I tried to work with some time ago. I don't know if it has been fixed in recent releases... My advice : SCO, just say NO! But if you HAVE to go with it, get Thomas Roell's X386 : It's X11R4, it uses shared libs, etc... and it's free. Also, V 1.1 should support local connection with SCO's client, that means you still may run xdt and Cie. Hope this help! -- Jean-Christophe (aka "Jessie") ------------------------------------------------------------------------------ jcc@axis-design.fr | "An artificial intelligence is better than none!" ..!inria!axis-design!jcc| "Artificial intelligence matches natural stupidity!" Collet Jean-Christophe | "Objets inanimes avez-vous donc une ame ?" ------------------------------------------------------------------------------ Axis Design | 119, rue de Flandres | 75019 Paris | France | Tel: +33 (1) 40 35 20 20 | ------------------------------------------------------------------------------