From owner-freebsd-questions@FreeBSD.ORG Wed Dec 13 18:59:36 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 071C716A412 for ; Wed, 13 Dec 2006 18:59:36 +0000 (UTC) (envelope-from brunson@brunson.com) Received: from mail.comfortechassist.com (66-162-108-54.static.twtelecom.net [66.162.108.54]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4A92943DE0 for ; Wed, 13 Dec 2006 18:55:20 +0000 (GMT) (envelope-from brunson@brunson.com) Received: by mail.comfortechassist.com (Postfix, from userid 509) id E0B9A11A0032; Wed, 13 Dec 2006 11:56:11 -0700 (MST) Received: from [172.20.31.94] (unknown [12.109.229.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.comfortechassist.com (Postfix) with ESMTP id 49E8711A0036 for ; Wed, 13 Dec 2006 11:56:10 -0700 (MST) Message-ID: <45804CC9.7090807@brunson.com> Date: Wed, 13 Dec 2006 11:56:09 -0700 From: Eric Brunson User-Agent: Thunderbird 1.5.0.8 (X11/20061107) MIME-Version: 1.0 To: freebsd-questions@freebsd.org References: <45803B96.5090402@brunson.com> <20061213183051.GA79921@owl.midgard.homeip.net> In-Reply-To: <20061213183051.GA79921@owl.midgard.homeip.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Checker-Version: SpamAssassin 3.0.6 (2005-12-07) on s4.comfortechassist.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=ham version=3.0.6 Subject: Re: Increasing ptys/ttys beyond 128 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Dec 2006 18:59:36 -0000 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.