From owner-freebsd-hackers@FreeBSD.ORG Tue Oct 2 12:05:14 2007 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1980516A418 for ; Tue, 2 Oct 2007 12:05:14 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id B550613C448 for ; Tue, 2 Oct 2007 12:05:13 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (localhost [127.0.0.1]) by spam.des.no (Postfix) with ESMTP id 2E0422091; Tue, 2 Oct 2007 14:05:04 +0200 (CEST) X-Spam-Tests: AWL X-Spam-Learn: disabled X-Spam-Score: 0.0/3.0 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on tim.des.no Received: from ds4.des.no (des.no [80.203.243.180]) by smtp.des.no (Postfix) with ESMTP id 111C0208E; Tue, 2 Oct 2007 14:05:04 +0200 (CEST) Received: by ds4.des.no (Postfix, from userid 1001) id EC26D844A1; Tue, 2 Oct 2007 14:05:03 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: "Steven Hartland" References: <001f01c80407$1358d490$b6db87d4@multiplay.co.uk> <00ab01c8040c$7c408160$b6db87d4@multiplay.co.uk> <012101c804e5$efa7e9c0$b6db87d4@multiplay.co.uk> Date: Tue, 02 Oct 2007 14:05:03 +0200 In-Reply-To: <012101c804e5$efa7e9c0$b6db87d4@multiplay.co.uk> (Steven Hartland's message of "Tue\, 2 Oct 2007 12\:18\:19 +0100") Message-ID: <86abr1yb68.fsf@ds4.des.no> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.1 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org, freebsd-stable@freebsd.org Subject: Re: How to enable more than 256 pty's? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Oct 2007 12:05:14 -0000 "Steven Hartland" writes: > Any one got any pointers on this, the machine we running this app on is o= ver > 90% idle so I really don't want to have to install a second machine just = to > workaround a limit on the number of pty's, surely there's a way to increa= se > this? You need to change the way ptys are named in pty_create_slave() and pty_clone() in sys/kern/tty_pty.c. Just changing names won't help as the sequence is also hardcoded in pty_clone(). You also need to change grantpt(), openpty() and any other userland code which has hardcoded knowledge of the naming scheme: des@ds4 ~% gfs pqrsPQRS src/sys/kern/tty_pty.c: static char *names =3D "pqrsPQRS"; src/sys/kern/tty_pty.c: * pts =3D=3D /dev/tty[pqrsPQRS][0123456789abcdefgh= ijklmnopqrstuv] src/sys/kern/tty_pty.c: * ptc =3D=3D /dev/pty[pqrsPQRS][0123456789abcdefgh= ijklmnopqrstuv] src/contrib/telnet/telnetd/sys_term.c: for (cp =3D "pqrsPQRS"; *cp; cp++) { src/usr.sbin/ac/ac.c: strchr("pqrsPQRS", usr.= ut_line[3]) !=3D 0 || src/lib/libutil/pty.c: for (cp1 =3D "pqrsPQRS"; *cp1; cp1++) { src/lib/libc/stdlib/grantpt.c: #define PT_DEV1 "pqrsPQRS" Alternatively, set kern.pts.enable to 1, and find and fix the hang-on-close bug in the pts code (if it hasn't been fixed already) DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no