=================================================================== RCS file: /home/hpa/kernel/bkcvs/linux-2.5/drivers/char/Kconfig,v retrieving revision 1.26 diff -u -r1.26 Kconfig --- linux-2.5/drivers/char/Kconfig 4 Feb 2004 18:43:44 -0000 1.26 +++ linux-2.5/drivers/char/Kconfig 9 Feb 2004 08:07:20 -0000 @@ -444,48 +444,6 @@ source "drivers/serial/Kconfig" -config UNIX98_PTYS - bool "Unix98 PTY support" - ---help--- - A pseudo terminal (PTY) is a software device consisting of two - halves: a master and a slave. The slave device behaves identical to - a physical terminal; the master device is used by a process to - read data from and write data to the slave, thereby emulating a - terminal. Typical programs for the master side are telnet servers - and xterms. - - Linux has traditionally used the BSD-like names /dev/ptyxx for - masters and /dev/ttyxx for slaves of pseudo terminals. This scheme - has a number of problems. The GNU C library glibc 2.1 and later, - however, supports the Unix98 naming standard: in order to acquire a - pseudo terminal, a process opens /dev/ptmx; the number of the pseudo - terminal is then made available to the process and the pseudo - terminal slave can be accessed as /dev/pts/. What was - traditionally /dev/ttyp2 will then be /dev/pts/2, for example. - - The entries in /dev/pts/ are created on the fly by a virtual - file system; therefore, if you say Y here you should say Y to - "/dev/pts file system for Unix98 PTYs" as well. - - If you want to say Y here, you need to have the C library glibc 2.1 - or later (equal to libc-6.1, check with "ls -l /lib/libc.so.*"). - Read the instructions in pertaining to - pseudo terminals. It's safe to say N. - -config UNIX98_PTY_COUNT - int "Maximum number of Unix98 PTYs in use (0-2048)" - depends on UNIX98_PTYS - default "256" - help - The maximum number of Unix98 PTYs that can be used at any one time. - The default is 256, and should be enough for desktop systems. Server - machines which support incoming telnet/rlogin/ssh connections and/or - serve several X terminals may want to increase this: every incoming - connection and every xterm uses up one PTY. - - When not in use, each additional set of 256 PTYs occupy - approximately 8 KB of kernel memory on 32-bit architectures. - config PRINTER tristate "Parallel printer support" depends on PARPORT =================================================================== RCS file: /home/hpa/kernel/bkcvs/linux-2.5/drivers/char/pty.c,v retrieving revision 1.23 diff -u -r1.23 pty.c --- linux-2.5/drivers/char/pty.c 24 Sep 2003 06:43:28 -0000 1.23 +++ linux-2.5/drivers/char/pty.c 10 Feb 2004 07:48:47 -0000 @@ -33,11 +33,9 @@ static struct tty_driver *pty_driver, *pty_slave_driver; -#ifdef CONFIG_UNIX98_PTYS /* These are global because they are accessed in tty_io.c */ struct tty_driver *ptm_driver; struct tty_driver *pts_driver; -#endif static void pty_close(struct tty_struct * tty, struct file * filp) { @@ -61,10 +59,8 @@ set_bit(TTY_OTHER_CLOSED, &tty->link->flags); if (tty->driver->subtype == PTY_TYPE_MASTER) { set_bit(TTY_OTHER_CLOSED, &tty->flags); -#ifdef CONFIG_UNIX98_PTYS if (tty->driver == ptm_driver) devpts_pty_kill(tty->index); -#endif tty_vhangup(tty->link); } } @@ -205,13 +201,11 @@ * master pty with the multi-headed ptmx device, then find out which * one we got after it is open, with an ioctl. */ -#ifdef CONFIG_UNIX98_PTYS static int pty_get_device_number(struct tty_struct *tty, unsigned int *value) { unsigned int result = tty->index; return put_user(result, value); } -#endif /* Set the lock flag on a pty */ static int pty_set_lock(struct tty_struct *tty, int * arg) @@ -240,7 +234,6 @@ return -ENOIOCTLCMD; } -#ifdef CONFIG_UNIX98_PTYS static int pty_unix98_ioctl(struct tty_struct *tty, struct file *file, unsigned int cmd, unsigned long arg) { @@ -255,7 +248,6 @@ return pty_bsd_ioctl(tty,file,cmd,arg); } -#endif static void pty_flush_buffer(struct tty_struct *tty) { @@ -365,13 +357,12 @@ /* Unix98 devices */ -#ifdef CONFIG_UNIX98_PTYS devfs_mk_dir("pts"); - printk("pty: %d Unix98 ptys configured\n", UNIX98_NR_MAJORS*NR_PTYS); - ptm_driver = alloc_tty_driver(UNIX98_NR_MAJORS * NR_PTYS); + printk("pty: %d Unix98 ptys configured\n", 1 << MINORBITS); + ptm_driver = alloc_tty_driver(1 << MINORBITS); if (!ptm_driver) panic("Couldn't allocate Unix98 ptm driver"); - pts_driver = alloc_tty_driver(UNIX98_NR_MAJORS * NR_PTYS); + pts_driver = alloc_tty_driver(1 << MINORBITS); if (!pts_driver) panic("Couldn't allocate Unix98 pts driver"); @@ -388,7 +379,7 @@ ptm_driver->init_termios.c_cflag = B38400 | CS8 | CREAD; ptm_driver->init_termios.c_lflag = 0; ptm_driver->flags = TTY_DRIVER_RESET_TERMIOS | TTY_DRIVER_REAL_RAW | - TTY_DRIVER_NO_DEVFS; + TTY_DRIVER_NO_DEVFS | TTY_DRIVER_DEVPTS_MEM; ptm_driver->other = pts_driver; tty_set_operations(ptm_driver, &pty_ops); ptm_driver->ioctl = pty_unix98_ioctl; @@ -402,8 +393,8 @@ pts_driver->subtype = PTY_TYPE_SLAVE; pts_driver->init_termios = tty_std_termios; pts_driver->init_termios.c_cflag = B38400 | CS8 | CREAD; - pts_driver->flags = TTY_DRIVER_RESET_TERMIOS | - TTY_DRIVER_REAL_RAW | TTY_DRIVER_NO_DEVFS; + pts_driver->flags = TTY_DRIVER_RESET_TERMIOS | TTY_DRIVER_REAL_RAW | + TTY_DRIVER_NO_DEVFS | TTY_DRIVER_DEVPTS_MEM; pts_driver->other = ptm_driver; tty_set_operations(pts_driver, &pty_ops); @@ -411,7 +402,6 @@ panic("Couldn't register Unix98 ptm driver"); if (tty_register_driver(pts_driver)) panic("Couldn't register Unix98 pts driver"); -#endif return 0; } module_init(pty_init); =================================================================== RCS file: /home/hpa/kernel/bkcvs/linux-2.5/drivers/char/tty_io.c,v retrieving revision 1.123 diff -u -r1.123 tty_io.c --- linux-2.5/drivers/char/tty_io.c 4 Feb 2004 18:31:40 -0000 1.123 +++ linux-2.5/drivers/char/tty_io.c 10 Feb 2004 07:28:49 -0000 @@ -105,7 +105,6 @@ #undef TTY_DEBUG_HANGUP -#define TTY_PARANOIA_CHECK 1 #define CHECK_TTY_COUNT 1 struct termios tty_std_termios = { /* for the benefit of tty drivers */ @@ -122,10 +121,8 @@ LIST_HEAD(tty_drivers); /* linked list of tty drivers */ struct tty_ldisc ldiscs[NR_LDISCS]; /* line disc dispatch table */ -#ifdef CONFIG_UNIX98_PTYS extern struct tty_driver *ptm_driver; /* Unix98 pty masters; for /dev/ptmx */ extern struct tty_driver *pts_driver; /* Unix98 pty slaves; for /dev/ptmx */ -#endif extern void disable_early_printk(void); @@ -799,7 +796,13 @@ down_tty_sem(idx); /* check whether we're reopening an existing tty */ - tty = driver->ttys[idx]; + if ( driver->flags & TTY_DRIVER_DEVPTS_MEM ) { + tty = devpts_get_tty(idx); + if ( tty && driver->subtype == PTY_TYPE_MASTER ) + tty = tty->link; + } else { + tty = driver->ttys[idx]; + } if (tty) goto fast_track; /* @@ -827,7 +830,14 @@ tty->index = idx; tty_line_name(driver, idx, tty->name); - tp_loc = &driver->termios[idx]; + if ( driver->flags & TTY_DRIVER_DEVPTS_MEM ) { + tp_loc = &tty->termios; + ltp_loc = &tty->termios_locked; + } else { + tp_loc = &driver->termios[idx]; + ltp_loc = &driver->termios_locked[idx]; + } + if (!*tp_loc) { tp = (struct termios *) kmalloc(sizeof(struct termios), GFP_KERNEL); @@ -836,7 +846,6 @@ *tp = driver->init_termios; } - ltp_loc = &driver->termios_locked[idx]; if (!*ltp_loc) { ltp = (struct termios *) kmalloc(sizeof(struct termios), GFP_KERNEL); @@ -854,7 +863,14 @@ o_tty->index = idx; tty_line_name(driver->other, idx, o_tty->name); - o_tp_loc = &driver->other->termios[idx]; + if ( driver->flags & TTY_DRIVER_DEVPTS_MEM ) { + o_tp_loc = &o_tty->termios; + o_ltp_loc = &o_tty->termios_locked; + } else { + o_tp_loc = &driver->other->termios[idx]; + o_ltp_loc = &driver->other->termios_locked[idx]; + } + if (!*o_tp_loc) { o_tp = (struct termios *) kmalloc(sizeof(struct termios), GFP_KERNEL); @@ -863,7 +879,6 @@ *o_tp = driver->other->init_termios; } - o_ltp_loc = &driver->other->termios_locked[idx]; if (!*o_ltp_loc) { o_ltp = (struct termios *) kmalloc(sizeof(struct termios), GFP_KERNEL); @@ -875,7 +890,9 @@ /* * Everything allocated ... set up the o_tty structure. */ - driver->other->ttys[idx] = o_tty; + if ( !(driver->other->flags & TTY_DRIVER_DEVPTS_MEM) ) { + driver->other->ttys[idx] = o_tty; + } if (!*o_tp_loc) *o_tp_loc = o_tp; if (!*o_ltp_loc) @@ -896,7 +913,9 @@ * Failures after this point use release_mem to clean up, so * there's no need to null out the local pointers. */ - driver->ttys[idx] = tty; + if ( !(driver->flags & TTY_DRIVER_DEVPTS_MEM) ) { + driver->ttys[idx] = tty; + } if (!*tp_loc) *tp_loc = tp; @@ -994,12 +1013,20 @@ { struct tty_struct *o_tty; struct termios *tp; + int devpts = tty->driver->flags & TTY_DRIVER_DEVPTS_MEM; if ((o_tty = tty->link) != NULL) { - o_tty->driver->ttys[idx] = NULL; + if ( !devpts ) + o_tty->driver->ttys[idx] = NULL; if (o_tty->driver->flags & TTY_DRIVER_RESET_TERMIOS) { - tp = o_tty->driver->termios[idx]; - o_tty->driver->termios[idx] = NULL; + tp = o_tty->termios; + if ( !devpts ) + o_tty->driver->termios[idx] = NULL; + kfree(tp); + + tp = o_tty->termios_locked; + if ( !devpts ) + o_tty->driver->termios_locked[idx] = NULL; kfree(tp); } o_tty->magic = 0; @@ -1010,12 +1037,20 @@ free_tty_struct(o_tty); } - tty->driver->ttys[idx] = NULL; + if ( !devpts ) + tty->driver->ttys[idx] = NULL; if (tty->driver->flags & TTY_DRIVER_RESET_TERMIOS) { - tp = tty->driver->termios[idx]; - tty->driver->termios[idx] = NULL; + tp = tty->termios; + if ( !devpts ) + tty->driver->termios[idx] = NULL; + kfree(tp); + + tp = tty->termios_locked; + if ( !devpts ) + tty->driver->termios_locked[idx] = NULL; kfree(tp); } + tty->magic = 0; tty->driver->refcount--; file_list_lock(); @@ -1329,21 +1364,24 @@ } if (device == MKDEV(TTYAUX_MAJOR,2)) { -#ifdef CONFIG_UNIX98_PTYS /* find a device that is not in use. */ + static int next_ptmx_dev = 0; retval = -1; driver = ptm_driver; - for (index = 0; index < driver->num ; index++) + while ( driver->refcount < driver->num ) { + index = next_ptmx_dev; + next_ptmx_dev = (next_ptmx_dev+1) % driver->num; if (!init_dev(driver, index, &tty)) goto ptmx_found; /* ok! */ + } return -EIO; /* no free ptys */ ptmx_found: set_bit(TTY_PTY_LOCK, &tty->flags); /* LOCK THE SLAVE */ - devpts_pty_new(index, MKDEV(pts_driver->major, pts_driver->minor_start) + index); + if ( devpts_pty_new(tty->link) ) { + /* BADNESS - need to destroy both ptm and pts! */ + return -ENOMEM; + } noctty = 1; -#else - return -ENODEV; -#endif /* CONFIG_UNIX_98_PTYS */ } else { driver = get_tty_driver(device, &index); if (!driver) @@ -2190,15 +2228,17 @@ int i; dev_t dev; char *s; - void **p; + void **p = NULL; if (driver->flags & TTY_DRIVER_INSTALLED) return 0; - p = kmalloc(driver->num * 3 * sizeof(void *), GFP_KERNEL); - if (!p) - return -ENOMEM; - memset(p, 0, driver->num * 3 * sizeof(void *)); + if ( !(driver->flags & TTY_DRIVER_DEVPTS_MEM) ) { + p = kmalloc(driver->num * 3 * sizeof(void *), GFP_KERNEL); + if (!p) + return -ENOMEM; + memset(p, 0, driver->num * 3 * sizeof(void *)); + } if (!driver->major) { error = alloc_chrdev_region(&dev, driver->minor_start, driver->num, @@ -2213,13 +2253,19 @@ (char*)driver->name); } if (error < 0) { - kfree(p); + if (p) kfree(p); return error; } - driver->ttys = (struct tty_struct **)p; - driver->termios = (struct termios **)(p + driver->num); - driver->termios_locked = (struct termios **)(p + driver->num * 2); + if ( p ) { + driver->ttys = (struct tty_struct **)p; + driver->termios = (struct termios **)(p + driver->num); + driver->termios_locked = (struct termios **)(p + driver->num * 2); + } else { + driver->ttys = NULL; + driver->termios = NULL; + driver->termios_locked = NULL; + } driver->cdev.kobj.parent = &tty_kobj; strcpy(driver->cdev.kobj.name, driver->name); @@ -2348,9 +2394,7 @@ postcore_initcall(tty_class_init); static struct cdev tty_cdev, console_cdev; -#ifdef CONFIG_UNIX98_PTYS static struct cdev ptmx_cdev; -#endif #ifdef CONFIG_VT static struct cdev vc0_cdev; #endif @@ -2380,7 +2424,6 @@ tty_kobj.kset = tty_cdev.kobj.kset; kobject_register(&tty_kobj); -#ifdef CONFIG_UNIX98_PTYS strcpy(ptmx_cdev.kobj.name, "dev.ptmx"); cdev_init(&ptmx_cdev, &tty_fops); if (cdev_add(&ptmx_cdev, MKDEV(TTYAUX_MAJOR, 2), 1) || @@ -2388,7 +2431,6 @@ panic("Couldn't register /dev/ptmx driver\n"); devfs_mk_cdev(MKDEV(TTYAUX_MAJOR, 2), S_IFCHR|S_IRUGO|S_IWUGO, "ptmx"); class_simple_device_add(tty_class, MKDEV(TTYAUX_MAJOR, 2), NULL, "ptmx"); -#endif #ifdef CONFIG_VT strcpy(vc0_cdev.kobj.name, "dev.vc0"); =================================================================== RCS file: /home/hpa/kernel/bkcvs/linux-2.5/fs/Kconfig,v retrieving revision 1.36 diff -u -r1.36 Kconfig --- linux-2.5/fs/Kconfig 30 Dec 2003 05:43:47 -0000 1.36 +++ linux-2.5/fs/Kconfig 9 Feb 2004 08:08:58 -0000 @@ -785,8 +785,7 @@ the file README there. Note that devfs no longer manages /dev/pts! If you are using UNIX98 - ptys, you will also need to enable (and mount) the /dev/pts - filesystem (CONFIG_DEVPTS_FS). + ptys, you will also need to mount the /dev/pts filesystem (devpts). Note that devfs has been obsoleted by udev, . @@ -819,32 +818,8 @@ If unsure, say N. -config DEVPTS_FS -# It compiles as a module for testing only. It should not be used -# as a module in general. If we make this "tristate", a bunch of people -# who don't know what they are doing turn it on and complain when it -# breaks. - bool "/dev/pts file system for Unix98 PTYs" - depends on UNIX98_PTYS - ---help--- - You should say Y here if you said Y to "Unix98 PTY support" above. - You'll then get a virtual file system which can be mounted on - /dev/pts with "mount -t devpts". This, together with the pseudo - terminal master multiplexer /dev/ptmx, is used for pseudo terminal - support as described in The Open Group's Unix98 standard: in order - to acquire a pseudo terminal, a process opens /dev/ptmx; the number - of the pseudo terminal is then made available to the process and the - pseudo terminal slave can be accessed as /dev/pts/. What was - traditionally /dev/ttyp2 will then be /dev/pts/2, for example. - - The GNU C library glibc 2.1 contains the requisite support for this - mode of operation; you also need client programs that use the Unix98 - API. Please read for more information - about the Unix98 pty devices. - config DEVPTS_FS_XATTR bool "/dev/pts Extended Attributes" - depends on DEVPTS_FS help Extended attributes are name:value pairs associated with inodes by the kernel or by users (see the attr(5) manual page, or visit =================================================================== RCS file: /home/hpa/kernel/bkcvs/linux-2.5/fs/devpts/Makefile,v retrieving revision 1.7 diff -u -r1.7 Makefile --- linux-2.5/fs/devpts/Makefile 25 Jul 2003 23:00:05 -0000 1.7 +++ linux-2.5/fs/devpts/Makefile 9 Feb 2004 08:13:06 -0000 @@ -2,8 +2,8 @@ # Makefile for the Linux /dev/pts virtual filesystem. # -obj-$(CONFIG_DEVPTS_FS) += devpts.o +obj-y += devpts.o -devpts-y := inode.o +devpts-y := inode.o devpts-$(CONFIG_DEVPTS_FS_XATTR) += xattr.o devpts-$(CONFIG_DEVPTS_FS_SECURITY) += xattr_security.o =================================================================== RCS file: /home/hpa/kernel/bkcvs/linux-2.5/fs/devpts/inode.c,v retrieving revision 1.19 diff -u -r1.19 inode.c --- linux-2.5/fs/devpts/inode.c 27 May 2003 00:00:37 -0000 1.19 +++ linux-2.5/fs/devpts/inode.c 10 Feb 2004 06:26:50 -0000 @@ -2,7 +2,7 @@ * * linux/fs/devpts/inode.c * - * Copyright 1998 H. Peter Anvin -- All Rights Reserved + * Copyright 1998-2004 H. Peter Anvin -- All Rights Reserved * * This file is part of the Linux kernel and is made available under * the terms of the GNU General Public License, version 2, or at your @@ -16,6 +16,8 @@ #include #include #include +#include +#include #include "xattr.h" #define DEVPTS_SUPER_MAGIC 0x1cd1 @@ -126,7 +128,7 @@ static struct dentry *get_node(int num) { - char s[10]; + char s[12]; struct dentry *root = devpts_root; down(&root->d_inode->i_sem); return lookup_one_len(s, root, sprintf(s, "%d", num)); @@ -139,12 +141,21 @@ .removexattr = devpts_removexattr, }; -void devpts_pty_new(int number, dev_t device) +int devpts_pty_new(struct tty_struct *tty) { + int number = tty->index; + struct tty_driver *driver = tty->driver; + dev_t device = MKDEV(driver->major, driver->minor_start+number); struct dentry *dentry; struct inode *inode = new_inode(devpts_mnt->mnt_sb); + + /* We're supposed to be given the slave end of a pty */ + BUG_ON(driver->type != TTY_DRIVER_TYPE_PTY); + BUG_ON(driver->subtype != PTY_TYPE_SLAVE); + if (!inode) - return; + return -ENOMEM; + inode->i_ino = number+2; inode->i_blksize = 1024; inode->i_uid = config.setuid ? config.uid : current->fsuid; @@ -152,11 +163,28 @@ inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; init_special_inode(inode, S_IFCHR|config.mode, device); inode->i_op = &devpts_file_inode_operations; + inode->u.generic_ip = tty; dentry = get_node(number); if (!IS_ERR(dentry) && !dentry->d_inode) d_instantiate(dentry, inode); + up(&devpts_root->d_inode->i_sem); + + return 0; +} + +struct tty_struct *devpts_get_tty(int number) +{ + struct dentry *dentry = get_node(number); + struct tty_struct *tty; + + tty = (IS_ERR(dentry) || !dentry->d_inode) ? NULL : + (struct tty_struct *)dentry->d_inode->u.generic_ip; + + up(&devpts_root->d_inode->i_sem); + + return tty; } void devpts_pty_kill(int number) =================================================================== RCS file: /home/hpa/kernel/bkcvs/linux-2.5/fs/proc/proc_tty.c,v retrieving revision 1.10 diff -u -r1.10 proc_tty.c --- linux-2.5/fs/proc/proc_tty.c 30 Dec 2003 05:42:07 -0000 1.10 +++ linux-2.5/fs/proc/proc_tty.c 10 Feb 2004 07:44:31 -0000 @@ -86,11 +86,9 @@ seq_printf(m, "%-20s /dev/%-8s ", "/dev/console", "console"); seq_printf(m, "%3d %7d ", TTYAUX_MAJOR, 1); seq_printf(m, "system:console\n"); -#ifdef CONFIG_UNIX98_PTYS seq_printf(m, "%-20s /dev/%-8s ", "/dev/ptmx", "ptmx"); seq_printf(m, "%3d %7d ", TTYAUX_MAJOR, 2); seq_printf(m, "system\n"); -#endif #ifdef CONFIG_VT seq_printf(m, "%-20s /dev/%-8s ", "/dev/vc/0", "vc/0"); seq_printf(m, "%3d %7d ", TTY_MAJOR, 0); =================================================================== RCS file: /home/hpa/kernel/bkcvs/linux-2.5/include/linux/devpts_fs.h,v retrieving revision 1.3 diff -u -r1.3 devpts_fs.h --- linux-2.5/include/linux/devpts_fs.h 5 Jul 2002 05:54:40 -0000 1.3 +++ linux-2.5/include/linux/devpts_fs.h 10 Feb 2004 06:26:26 -0000 @@ -13,21 +13,8 @@ #ifndef _LINUX_DEVPTS_FS_H #define _LINUX_DEVPTS_FS_H 1 -#ifdef CONFIG_DEVPTS_FS - -void devpts_pty_new(int, dev_t); /* mknod in devpts */ -void devpts_pty_kill(int); /* unlink */ - -#else - -static inline void devpts_pty_new(int line, dev_t device) -{ -} - -static inline void devpts_pty_kill(int line) -{ -} - -#endif +int devpts_pty_new(struct tty_struct *); /* mknod in devpts */ +struct tty_struct *devpts_get_tty(int); /* get tty structure */ +void devpts_pty_kill(int); /* unlink */ #endif /* _LINUX_DEVPTS_FS_H */ =================================================================== RCS file: /home/hpa/kernel/bkcvs/linux-2.5/include/linux/tty.h,v retrieving revision 1.22 diff -u -r1.22 tty.h --- linux-2.5/include/linux/tty.h 24 Sep 2003 06:43:28 -0000 1.22 +++ linux-2.5/include/linux/tty.h 10 Feb 2004 07:38:22 -0000 @@ -28,29 +28,11 @@ /* - * Note: don't mess with NR_PTYS until you understand the tty minor - * number allocation game... * (Note: the *_driver.minor_start values 1, 64, 128, 192 are * hardcoded at present.) */ -#define NR_PTYS 256 /* ptys/major */ +#define NR_PTYS 256 /* Number of legacy ptys */ #define NR_LDISCS 16 - -/* - * Unix98 PTY's can be defined as any multiple of NR_PTYS up to - * UNIX98_PTY_MAJOR_COUNT; this section defines what we need from the - * config options - */ -#ifdef CONFIG_UNIX98_PTYS -# define UNIX98_NR_MAJORS ((CONFIG_UNIX98_PTY_COUNT+NR_PTYS-1)/NR_PTYS) -# if UNIX98_NR_MAJORS <= 0 -# undef CONFIG_UNIX98_PTYS -# elif UNIX98_NR_MAJORS > UNIX98_PTY_MAJOR_COUNT -# error Too many Unix98 ptys defined -# undef UNIX98_NR_MAJORS -# define UNIX98_NR_MAJORS UNIX98_PTY_MAJOR_COUNT -# endif -#endif /* * These are set up by the setup-routine at boot-time: =================================================================== RCS file: /home/hpa/kernel/bkcvs/linux-2.5/include/linux/tty_driver.h,v retrieving revision 1.12 diff -u -r1.12 tty_driver.h --- linux-2.5/include/linux/tty_driver.h 12 Jun 2003 04:41:09 -0000 1.12 +++ linux-2.5/include/linux/tty_driver.h 10 Feb 2004 05:51:03 -0000 @@ -160,9 +160,10 @@ const char *devfs_name; const char *name; int name_base; /* offset of printed name */ - short major; /* major device number */ - short minor_start; /* start of minor device number*/ - short num; /* number of devices */ + int major; /* major device number */ + int minor_start; /* start of minor device number */ + int minor_num; /* number of *possible* devices */ + int num; /* number of devices allocated */ short type; /* type of tty driver */ short subtype; /* subtype of tty driver */ struct termios init_termios; /* Initial termios */ @@ -244,11 +245,15 @@ * TTY_DRIVER_NO_DEVFS --- if set, do not create devfs entries. This * is only used by tty_register_driver(). * + * TTY_DRIVER_DEVPTS_MEM -- don't use the standard arrays, instead + * use dynamic memory keyed through the devpts filesystem. This + * is only applicable to the pty driver. */ #define TTY_DRIVER_INSTALLED 0x0001 #define TTY_DRIVER_RESET_TERMIOS 0x0002 #define TTY_DRIVER_REAL_RAW 0x0004 #define TTY_DRIVER_NO_DEVFS 0x0008 +#define TTY_DRIVER_DEVPTS_MEM 0x0010 /* tty driver types */ #define TTY_DRIVER_TYPE_SYSTEM 0x0001