[comp.windows.interviews] portability of InterViews-3.0 to Ultrix: problems and fixes

mcgeer@ATHOS.BERKELEY.EDU (06/01/91)

I have recently completed an installation of InterViews on a DECstation
5500 under Ultrix.  We used the AT&T 2.1 compiler and we run MIT X11, Release 4.

After the general shakedown, two compile problems remained which
required a patch to the source.  I haven't posted this as a fix, since
I'm not sure that the patches I put in were correct.

(1) Dispatch/dispatcher.c calls select twice.  Arguments 2-4 are
declared as FdMask& 's, which for all practical purposes to the linker
are fd_set * 's.  An fd_set in Sun OS is a structure with a single long
element, which is a bit-vector.  Ultrix uses int *'s for the arguments.
 As nearly as I can tell from the man pages, the int *'s represent the
same things and are similarly encoded.  My fix was simply to cast off
the fd_set *'s to int *'s; e.g:

	/* nfound = select(_nfds, &rmaskret, &wmaskret, &emaskret, howlong); */
        nfound = select(_nfds, (int *)&rmaskret, (int *)&wmaskret, (int *)&emask
ret, howlong);

A better solution, I think, would be to write a Dispatch::selector
which provides a reasonable wrapper to the system calls.

(2) IV-X11/xworld.c, line 591, routine World::inputReady: Under ultrix,
the third argument to ioctl must be a char *.  Solved by casting &pending to char *.

						-- Rick