How to increase number of pseudo terminals?

sundance markb at ea.ucla.edu
Sat Mar 11 10:22:07 AEST 1989


On my Sun4/280 with SunOS 4.0, we have numerous remote logins.  We run out
of pseudo tty's and receive the following error:

    ldtermopen: open fails, can't allocate state structure
    ldtermopen: open fails, can't allocate state structure

So we look at the /dev/tty[p,q,r][0-e] entries created by MAKEDEV and
find:

    crw--w----  1 miriam    20,   0 Feb 27 09:25 /dev/ttyp0
    crwx-w----  1 candida   20,   1 Feb 27 10:40 /dev/ttyp1*
                     .
                     .
                     .
    crw--w----  1 maria     20,  38 Feb 27 10:44 /dev/ttyr6
    crwx-w----  1 winifred  20,  39 Feb 27 10:32 /dev/ttyr7*
    crw-rw-rw-  1 root      20,  40 May 27  1988 /dev/ttyr8
    crw-rw-rw-  1 root      20,  41 May 27  1988 /dev/ttyr9
    crw-rw-rw-  1 root      20,  42 May 27  1988 /dev/ttyra
    crw-rw-rw-  1 root      20,  43 May 27  1988 /dev/ttyrb
    crw-rw-rw-  1 root      20,  44 May 27  1988 /dev/ttyrc
    crw-rw-rw-  1 root      20,  45 May 27  1988 /dev/ttyrd
    crw-rw-rw-  1 root      20,  46 May 27  1988 /dev/ttyre
    crw-rw-rw-  2 root      20,  47 May 27  1988 /dev/ttyrf

This means that only 40 pseudo terminals are supported; the last eight
devices are never accessed.  In the system configuration file we have
MAXUSERS = 90. 

I looked all over the place in param.c and elsewhere for something that
would be in charge of pseudo tty's.  I even grepped for 40 to find it that
way.  No luck.  Does anyone know where I'd find the parameter to increase
the number of pseudo tty's?

Thanks --
Mark Bell   
UCLA Engineering School
markb at ea.ucla.edu 

[[ Since you are getting that particular error message, you must have
already bumped up the number of available streams (the define for NSTREAM
in param.c).  Turns out that that isn't enough.  Try the command "netstat
-m".  For some weird reason, this command also tells you about stream
allocations (seems inappropriate for "netstat" to me).  If your machine is
like ours, it will probably tell you that you have a very large number of
allocation failures for 128-sized dblocks.  If this is the case, try
doubling the number that is defined to be NBLK128 in (kernelname)/param.c.
We have not tried this last step yet, but the guy from the answer center
(who finally called us five weeks after we logged the call on this one)
seemed to think that that would do the trick.  The problem is that the
memory pools for these blocks are statically allocated and their sizes are
not dependent on anything (not even "MAXUSERS").  A rather reliable source
tells me that under 4.1 these blocks will be dynamically allocated, thus
fixing the general problem.  While you're looking at that file, make sure
that NSTREAM is at least 64.  --wnl ]]



More information about the Comp.sys.sun mailing list