This is the mail archive of the
cygwin-xfree@cygwin.com
mailing list for the Cygwin XFree86 project.
Re: lesstif mwm bug
- From: Christopher Faylor <cgf at redhat dot com>
- To: cygwin-xfree at cygwin dot com
- Date: Tue, 7 May 2002 14:13:08 -0400
- Subject: Re: lesstif mwm bug
- References: <200205070721.JAA01875@r2d2.physik3.gwdg.de>
- Reply-to: cygwin-xfree at cygwin dot com
On Tue, May 07, 2002 at 09:21:52AM +0200, Hans Werner Strube wrote:
>> From: Hans Werner Strube <strube@physik3.gwdg.de>
>
>> The mwm from lesstif eats up 99 % of CPU time, both in the binary package
>> and in a self-compiled version. I found that the select() calls in events.c
>> do not wait but immediately fail with errno = EBADF, although fd_width is 256
>> and x_fd is 3 or 4 (printed out in mwm.c). I have not yet found the reason,
>> only a dirty workaround: Replace the select by usleep(10000).
>
>Now I found the reason of the bug. Whereas fd_width is 256, FD_SETSIZE (the
>number of bits in fd_set variables) is only 64, so that select() tests for
>unpredictable file descriptors from 64 to 255. For mwm, as x_fd has low
>values, it will be sufficient to limit fd_width in mwm.c:
>if(fd_width > FD_SETSIZE) fd_width = FD_SETSIZE;
>More generally, the value of FD_SETSIZE in /usr/include/sys/types.h should
>be increased (as the comments say, to >= NOFILE from param.h)!
You can set this up yourself if it is important to you. Just define
FD_SETSIZE before including sys/types.h.
cgf