Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Dec 2006 19:30:51 +0100
From:      Erik Trulsson <ertr1013@student.uu.se>
To:        Eric Brunson <brunson@brunson.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Increasing ptys/ttys beyond 128
Message-ID:  <20061213183051.GA79921@owl.midgard.homeip.net>
In-Reply-To: <45803B96.5090402@brunson.com>
References:  <45803B96.5090402@brunson.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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@student.uu.se



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20061213183051.GA79921>