Pseudo-Terminal Allocation Before Solaris 8
By Alan Hargreaves-Oracle on Apr 11, 2005
My brother was having some problems with his Solaris 7 systems running out of pty's. We managed another workaround that enabled him to login and sort things out (which I might discuss later), but he'd been searching the web for information on this and turned up www.xegypt.net/articles/os/ptys.txt. I'm going to quote part of the page, but before I do, Let me say this right now, ...
DO NOT DO THIS. IT IS RISKY, WRONG AND YOU COULD PANIC YOUR SYSTEM.
The riskier way, and which I have personally confirmed to be working is done on-the-fly by writing symbols in the kernel image. Advantage? You don't have to reboot. As root, type this:#adb -k -w /dev/ksyms /dev/mem pt_cnt/W80 npty/W80 $q
The problem with doing this is that Solaris uses the boot-time values to allocate various structures associated with ptys, including a number of arrays (ptms_tty and pty_softc). If we change pt_cnt and/or npty on the fly, we risk working with memory beyond what was allocated to these arrays.
At best it will write over some data that we aren't using. At worst we could panic the box by writing to unmapped memory, or worse again, we could silently modify data associated with another part of the kernel.
The only way to increase the number of ptys on Solaris 7 and earlier involves a reboot and is the first method that he recommended.
The more reliable way to do this is to append the following two lines in /etc/system and rebooting:set npty=128 set pt_cnt=128
The issue went away with Solaris 8, at that point pty allocation became dynamic.