Increasing ptys/ttys beyond 128
Eric Brunson
brunson at brunson.com
Wed Dec 13 10:59:36 PST 2006
Erik Trulsson wrote:
> 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.)
>
Actually, that is incredibly helpful. We're having problems with
expect, but when expect searches for a free pty, it only searches
[0-9a-f], which only gives us 128 ptys. There's another problem with
this search resulting in failures after 64 pty allocations which I was
trying to avoid patching in expect, but if I can get 256 processes out
of it, I'll patch away.
Man, 5 days of searching the web and you set me straight in 48
minutes... I should have started here first. :-)
Thanks a *ton*!
> (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.
More information about the freebsd-questions
mailing list