Increasing ptys/ttys beyond 128

Erik Trulsson ertr1013 at student.uu.se
Wed Dec 13 10:31:34 PST 2006


On Wed, Dec 13, 2006 at 10:42:46AM -0700, Eric Brunson wrote:
> I've done some searching on the web, but everything I've come across is 
> either out of date and says to recompile the kernel, or else says that 
> after 5.1 the devfs does it automatically.  I don't think that's the case.
> 
> I'm running 6.1 and I need more than the [pt]ty[p-sP-S] devices that 
> will auto-clone in devfs.
> 
> I've tried adding lines like the following to /etc/default/devfs.rules:
> 
> add path 'ptyt*' unhide
> add path 'ttyt*' unhide
> 
> But that doesn't do the trick.  The syntax "unhide" implies to me that 
> the [p-sP-S] nodes exist but but are hidden by the hide_all ruleset.
> 
> What do I have to do to allow the creation of more ptys?

I don't think you can have more than 256 pty devices in 6.1

The code in the kernel that handles ptys only allow for pty[pqrsPQRS][0-9a-v]
(and the corresponding tty[pqrsPQRS][0-9a-v] of course.)  This gives you a
total of 8*32 = 256 pty devices. (Not 128 as the subjectline implies.)

(I don't think you could have more than 256 ptys back in 4.x either, but
 back then the default setup only gave you 32 ptys, and all the instructions 
 I have seen for increasing that number only told how to let you use all 256
 possible devices, but not more than that.)


To get more ptys than 256 you will have to start hacking the kernel.  (There
does seem to be an alternate naming system for ptys available in 7-CURRENT
but it has not been back-ported to 6.x.  See the pty(4) manpage from
-CURRENT for details on how it works.)




-- 
<Insert your favourite quote here.>
Erik Trulsson
ertr1013 at student.uu.se


More information about the freebsd-questions mailing list