Subject: Re: Xlib: Maximum number of clients reached
To: None <netbsd-help@NetBSD.org>
From: Geoff Wing <gcw@pobox.com>
List: netbsd-help
Date: 10/17/2004 19:08:23
"Jeremy C. Reed" <reed@reedmedia.net> output:
:On Sat, 16 Oct 2004, Geoff Wing wrote:
:Is there any tool to quickly count the different current usages of a
:process? And of a process and all of its childred/descendents? (Or do I
:need to just write scripts to parse ps and fstat output? Anyone already
:do that?)

You'll have to write your own, probably.

:> MaxClients for the server is set from getdtablesize() during initialisation.
:I wonder why it is pre-set. Would it be inefficient to check this each
:time a new X client requests/tells the X server it is there?

It's easy to do it at process start.  Just malloc() space for your
file descriptor array then you only need to select() over that array.  You
could have it realloc() on finding a fd greater than currently held though
generally it's rare for people to increase limits during run-time.  It's
wouldn't be a hard exercise to change it to be more flexible.

Regards,
-- 
Geoff Wing : <gcw@pobox.com>