Date: Thu, 2 Apr 2009 08:24:10 +0200 From: Ed Schouten <ed@80386.nl> To: FreeBSD Hackers <freebsd-hackers@freebsd.org> Subject: Re: How to increase the max pty's on Freebsd 7.0? Message-ID: <20090402062410.GS13393@hoeg.nl> In-Reply-To: <20090402052900.GL2351@stlux503.dsto.defence.gov.au> References: <A48E38AADF784030A7496551F1416A3B@multiplay.co.uk> <20090401205306.GO13393@hoeg.nl> <20090402052900.GL2351@stlux503.dsto.defence.gov.au>
next in thread | previous in thread | raw e-mail | index | archive | help
--Jl+DbTnyraiZ/loT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Alex, * Wilkinson, Alex <alex.wilkinson@dsto.defence.gov.au> wrote: >=20 > 0n Wed, Apr 01, 2009 at 10:53:06PM +0200, Ed Schouten wrote:=20 >=20 > >You can increase the maximum amount of PTYs by editing a lot of sour= ce > >files on your system. There is some good news: in -CURRENT we switch= ed > >to Unix98-style PTYs (/dev/pts/%u). Right now the maximum amount of = PTYs > >is limited to 1000 (0 to 999). >=20 > What are "Unix98-style PTYs" ? Unix98-style PTYS is a name often given to implementations of pseudo-terminals that use a character device called /dev/ptmx to allocate a new pseudo-terminal. After /dev/ptmx has been opened, it will expose a new TTY in /dev/pts. The name of the TTY can be obtained using routines like ptsname(). Operating systems like Linux and Solaris use this as well. FreeBSD's pts(4) driver also has a /dev/ptmx character device, but it's just there for compatibility (Linux binary emulation, older -CURRENT libcs). The preferred way to allocate pseudo-terminals is to call posix_openpt(2). An advantage of the current design is that allocating pseudo-terminals can be done a lot more easily. On RELENG_[67] posix_openpt(3) is a libc routine that has to loop through devfs to search for the first unused pseudo-terminal. It also requires a set-uid utility (pt_chown) to change the ownership of the TTY: http://svn.freebsd.org/viewvc/base/stable/7/lib/libc/stdlib/grantpt.c?view= =3Dmarkup In -CURRENT the TTYs are allocated on demand with the proper permissions in place. --=20 Ed Schouten <ed@80386.nl> WWW: http://80386.nl/ --Jl+DbTnyraiZ/loT Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAknUWgoACgkQ52SDGA2eCwUogACfWTndxkVTP2OduKeWToxwWmzN b2MAniGK1b2zcKYwnmhcmcOHd+Hfa5Hk =nQ3I -----END PGP SIGNATURE----- --Jl+DbTnyraiZ/loT--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090402062410.GS13393>