How to increase number of pseudo terminals

Guy Harris auspex!guy at uunet.uu.net
Thu Mar 30 04:49:11 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

As William LeFebvre indicated, you have to crank up the number of 128-byte
streams dblocks, since "ldterm" (the "standard tty line discipline"
streams module) snarfs a 128-byte streams dblock to hold its internal
state when an instance of it is pushed onto a tty stream.

>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.

By default, the system is, as I remember, configured for 48 pseudo-ttys.
If you need more, in addition to increasing the number of stream heads
(which will, I expect, be dynamically allocated in 4.1, so you won't have
to configure it there) and 128-byte dblocks, you will also have to
increase the number of pseudo-ttys.

There *is* a config-file line that controls the number of pseudo-ttys
supported, and increasing it should work under 4.0 (it didn't work under
previous releases, since the number was compiled into "tty_pty.c"; 4.0 has
a "tty_ptyconf.c").  The line is

	pseudo-device	pty		# pseudo-tty's, also needed for SunView

which defaults to 48 pseudo-ttys, as I remember.  If you want 64, try

	pseudo-device	pty64

Note that, since programs search for an "unused" pseudo-tty by trying
"/dev/ptyp0" to see if it's in use, and then cycling up to "/dev/ptysf",
they will generally only check the first 64 possible pseudo-ttys, so even
if you do boost the number above 64 "rlogind", "telnetd", "script",
"shelltool", etc. may not see any past the first 64.  (This problem is,
most likely, common to most systems with BSD-derived pseudo-tty code and
BSD-derived network servers.  I expect the S5R4 pseudo-tty mechanism not
to require you to manually search for an unused pseudo-tty; after all, the
driver knows which ones are free, and if the driver supports a "clone
open" it will pick a free one for you.  This should mean programs won't
have to "know" how many pseudo-ttys to search through.)



More information about the Comp.sys.sun mailing list