How to enable more than 256 pty's?

Vlad GALU dudu at dudu.ro
Tue Oct 2 05:38:23 PDT 2007


On 10/2/07, Dag-Erling Smørgrav <des at des.no> wrote:
> "Steven Hartland" <killing at multiplay.co.uk> writes:
> > Any one got any pointers on this, the machine we running this app on is over
> > 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 increase
> > 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 at ds4 ~% gfs pqrsPQRS
> src/sys/kern/tty_pty.c: static char *names = "pqrsPQRS";
> src/sys/kern/tty_pty.c:  * pts == /dev/tty[pqrsPQRS][0123456789abcdefghijklmnopqrstuv]
> src/sys/kern/tty_pty.c:  * ptc == /dev/pty[pqrsPQRS][0123456789abcdefghijklmnopqrstuv]
> src/contrib/telnet/telnetd/sys_term.c:  for (cp = "pqrsPQRS"; *cp; cp++) {
> src/usr.sbin/ac/ac.c:                               strchr("pqrsPQRS", usr.ut_line[3]) != 0 ||
> src/lib/libutil/pty.c:  for (cp1 = "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)

    Looks like it hasn't been. A friend who tried to set up an access
server for his company stumbled upon it.

>
> DES
> --
> Dag-Erling Smørgrav - des at des.no
> _______________________________________________
> freebsd-hackers at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe at freebsd.org"
>


-- 
If it's there, and you can see it, it's real.
If it's not there, and you can see it, it's virtual.
If it's there, and you can't see it, it's transparent.
If it's not there, and you can't see it, you erased it.


More information about the freebsd-stable mailing list