diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2007-08-15 12:25:38 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-10-12 14:51:09 -0700 |
commit | dc8c85871c9728c5fddca6854a191fd41eb9438c (patch) | |
tree | d56e7a4c4d797d6696f24ef374cfd35865d5a5dd /drivers/char/pty.c | |
parent | 45aaae9c51d768d5a8fd53fb372b1eb714f37691 (diff) | |
download | lwn-dc8c85871c9728c5fddca6854a191fd41eb9438c.tar.gz lwn-dc8c85871c9728c5fddca6854a191fd41eb9438c.zip |
PTY: add kernel parameter to overwrite legacy pty count
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/char/pty.c')
-rw-r--r-- | drivers/char/pty.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/char/pty.c b/drivers/char/pty.c index de14aea34e11..73de77105fea 100644 --- a/drivers/char/pty.c +++ b/drivers/char/pty.c @@ -248,14 +248,19 @@ static int pty_bsd_ioctl(struct tty_struct *tty, struct file *file, return -ENOIOCTLCMD; } +static int legacy_count = CONFIG_LEGACY_PTY_COUNT; +module_param(legacy_count, int, 0); + static void __init legacy_pty_init(void) { + if (legacy_count <= 0) + return; - pty_driver = alloc_tty_driver(NR_PTYS); + pty_driver = alloc_tty_driver(legacy_count); if (!pty_driver) panic("Couldn't allocate pty driver"); - pty_slave_driver = alloc_tty_driver(NR_PTYS); + pty_slave_driver = alloc_tty_driver(legacy_count); if (!pty_slave_driver) panic("Couldn't allocate pty slave driver"); |