mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 11:46:19 +00:00
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>
This commit is contained in:
parent
45aaae9c51
commit
dc8c85871c
3 changed files with 11 additions and 3 deletions
|
@ -1430,6 +1430,10 @@ and is between 256 and 4096 characters. It is defined in the file
|
||||||
pt. [PARIDE]
|
pt. [PARIDE]
|
||||||
See Documentation/paride.txt.
|
See Documentation/paride.txt.
|
||||||
|
|
||||||
|
pty.legacy_count=
|
||||||
|
[KNL] Number of legacy pty's. Overwrites compiled-in
|
||||||
|
default number.
|
||||||
|
|
||||||
quiet [KNL] Disable most log messages
|
quiet [KNL] Disable most log messages
|
||||||
|
|
||||||
r128= [HW,DRM]
|
r128= [HW,DRM]
|
||||||
|
|
|
@ -248,14 +248,19 @@ static int pty_bsd_ioctl(struct tty_struct *tty, struct file *file,
|
||||||
return -ENOIOCTLCMD;
|
return -ENOIOCTLCMD;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int legacy_count = CONFIG_LEGACY_PTY_COUNT;
|
||||||
|
module_param(legacy_count, int, 0);
|
||||||
|
|
||||||
static void __init legacy_pty_init(void)
|
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)
|
if (!pty_driver)
|
||||||
panic("Couldn't allocate 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)
|
if (!pty_slave_driver)
|
||||||
panic("Couldn't allocate pty slave driver");
|
panic("Couldn't allocate pty slave driver");
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
* (Note: the *_driver.minor_start values 1, 64, 128, 192 are
|
* (Note: the *_driver.minor_start values 1, 64, 128, 192 are
|
||||||
* hardcoded at present.)
|
* hardcoded at present.)
|
||||||
*/
|
*/
|
||||||
#define NR_PTYS CONFIG_LEGACY_PTY_COUNT /* Number of legacy ptys */
|
|
||||||
#define NR_UNIX98_PTY_DEFAULT 4096 /* Default maximum for Unix98 ptys */
|
#define NR_UNIX98_PTY_DEFAULT 4096 /* Default maximum for Unix98 ptys */
|
||||||
#define NR_UNIX98_PTY_MAX (1 << MINORBITS) /* Absolute limit */
|
#define NR_UNIX98_PTY_MAX (1 << MINORBITS) /* Absolute limit */
|
||||||
#define NR_LDISCS 17
|
#define NR_LDISCS 17
|
||||||
|
|
Loading…
Reference in a new issue