Re: networking/newer kernels (offtopic)

Michael Marxmeier (mike@msede.com)
Tue, 03 Feb 1998 00:21:45 +0100


Mark Robert Hale wrote:
>
> I'm running RedHat 4.2 + Xig's CDE. For production
> purposes, I'm using 2.0.33.
>
> For experimental purposes (e.g., to get my UDMA
> drivers working faster) I've attempted to use various
> of the 2.1 kernels (2.1.84, 2.1.70, 2.1.64). Compiling
> & booting is no problem, but CDE gives an error

That's a bug in XIG's ttsession. They do something very
stupid with select() - announcing a bitmap of 1024 fd's
but initializing only the first 1024 (according to strace).
This should hurt them on 2.0.x as well if you use more than
256 fd's.

As a workaround (to get CDE running), you can preload a
wrapper library around select() in /usr/dt/bin/Xsession.
The code below helped me to get it up:

/* sel.c */

#include <stdio.h>
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>

extern int __select(int n, fd_set *readfds, fd_set *writefds,
fd_set *exceptfds, struct timeval *timeout);

int select(int n, fd_set *readfds, fd_set *writefds,
fd_set *exceptfds, struct timeval *timeout)
{
if(n > 256) {
/* fprintf(stderr, "select(n=%d,...)\n", n); */
n = 256;
}
return __select(n, readfds, writefds, exceptfds, timeout);
}

Compile as a shared library and preload before starting ttsession.

Hope this helps
Michael

-- 
Michael Marxmeier           Marxmeier Software GmbH
E-Mail: mike@msede.com      Suedstrasse 58
Voice : +49 202 2431440     42119 Wuppertal, Germany
Fax   : +49 202 2431420     http://www.msede.com/