summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/libutil/pty.c11
-rw-r--r--share/man/man4/pty.44
-rw-r--r--sys/kern/tty_pty.c10
3 files changed, 13 insertions, 12 deletions
diff --git a/lib/libutil/pty.c b/lib/libutil/pty.c
index a8fa7671537..bd6fa2cfb8c 100644
--- a/lib/libutil/pty.c
+++ b/lib/libutil/pty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pty.c,v 1.11 2004/02/10 01:31:20 millert Exp $ */
+/* $OpenBSD: pty.c,v 1.12 2004/04/11 18:04:36 millert Exp $ */
/*-
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
@@ -30,7 +30,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
/* from: static char sccsid[] = "@(#)pty.c 8.1 (Berkeley) 6/4/93"; */
-static const char rcsid[] = "$Id: pty.c,v 1.11 2004/02/10 01:31:20 millert Exp $";
+static const char rcsid[] = "$Id: pty.c,v 1.12 2004/04/11 18:04:36 millert Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/cdefs.h>
@@ -49,6 +49,7 @@ static const char rcsid[] = "$Id: pty.c,v 1.11 2004/02/10 01:31:20 millert Exp $
#include "util.h"
#define TTY_LETTERS "pqrstuvwxyzPQRST"
+#define TTY_SUFFIX "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
int
openpty(amaster, aslave, name, termp, winp)
@@ -58,8 +59,8 @@ openpty(amaster, aslave, name, termp, winp)
struct winsize *winp;
{
char line[] = "/dev/ptyXX";
- register const char *cp1, *cp2;
- register int master, slave, ttygid;
+ const char *cp1, *cp2;
+ int master, slave, ttygid;
struct group *gr;
struct ptmget ptm;
int fd;
@@ -103,7 +104,7 @@ openpty(amaster, aslave, name, termp, winp)
for (cp1 = TTY_LETTERS; *cp1; cp1++) {
line[8] = *cp1;
- for (cp2 = "0123456789abcdef"; *cp2; cp2++) {
+ for (cp2 = TTY_SUFFIX; *cp2; cp2++) {
line[9] = *cp2;
line[5] = 'p';
if ((master = open(line, O_RDWR, 0)) == -1) {
diff --git a/share/man/man4/pty.4 b/share/man/man4/pty.4
index 9da57b4fa82..eca0ce5b67d 100644
--- a/share/man/man4/pty.4
+++ b/share/man/man4/pty.4
@@ -1,4 +1,4 @@
-.\" $OpenBSD: pty.4,v 1.13 2004/03/21 19:47:59 miod Exp $
+.\" $OpenBSD: pty.4,v 1.14 2004/04/11 18:04:36 millert Exp $
.\" $NetBSD: pty.4,v 1.4 1998/03/21 03:14:30 fair Exp $
.\"
.\" Copyright (c) 1983, 1991, 1993
@@ -73,7 +73,7 @@ This is not a hard limit--space for additional pseudo terminal pairs
is allocated on demand up to the limit imposed by the
.Li kern.tty.maxptys
.Xr sysctl 8
-(256 by default).
+(992 by default).
.Pp
The following
.Xr ioctl 2
diff --git a/sys/kern/tty_pty.c b/sys/kern/tty_pty.c
index 5a4506f960e..fb7f9fbf34a 100644
--- a/sys/kern/tty_pty.c
+++ b/sys/kern/tty_pty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty_pty.c,v 1.21 2004/04/11 16:41:30 millert Exp $ */
+/* $OpenBSD: tty_pty.c,v 1.22 2004/04/11 18:04:36 millert Exp $ */
/* $NetBSD: tty_pty.c,v 1.33.4.1 1996/06/02 09:08:11 mrg Exp $ */
/*
@@ -61,13 +61,13 @@
#define BUFSIZ 100 /* Chunk size iomoved to/from user */
/*
- * pts == /dev/tty[p-zP-T][0-9a-f]
- * ptc == /dev/pty[p-zP-T][0-9a-f]
+ * pts == /dev/tty[p-zP-T][0-9a-zA-Z]
+ * ptc == /dev/pty[p-zP-T][0-9a-zA-Z]
*/
/* XXX this needs to come from somewhere sane, and work with MAKEDEV */
#define TTY_LETTERS "pqrstuvwxyzPQRST"
-#define TTY_SUFFIX "0123456789abcdef"
+#define TTY_SUFFIX "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
static int pts_major;
@@ -82,7 +82,7 @@ struct pt_softc {
};
#define DEFAULT_NPTYS 8 /* default number of initial ptys */
-#define DEFAULT_MAXPTYS 256 /* default maximum number of ptys */
+#define DEFAULT_MAXPTYS 992 /* default maximum number of ptys */
static struct pt_softc **pt_softc = NULL; /* pty array */
static int npty = 0; /* size of pty array */