[lkml]   [1998]   [Mar]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    Subjectdynamic pty driver...
    I'm working on a dynamic pty driver.  The purpose being to allow the
    creation of ptys by normal users (no more suid root screen!) and to allow
    the creation of an almost unlimited number of ptys without wasting a bunch
    of RAM for huge arrays on small systems or trying to switch to 16-bit minors
    or anything like that. The ptys would not have associated files/devices and
    they'd be made using a syscall similar to pipe() (should I make a new
    syscall or just an ioctl()?). Another possibility would be to add another
    filetype for mknod(), S_IFPTY that normal users could create, but this
    doesn't seem reasonable to me and I am unlikely to bother to implement it.
    It would be trivial to modify rxvt, screen, etc. to use these instead of
    /dev/pty* and /dev/tty[p-za-e]?.

    It looks like the best way to do this is to make a different
    tty_driver struct for every pty. I'm not sure what major/minor to give
    them...I was thinking I could probably just make all of them 5,0 (/dev/tty),
    but this would cause ps to see 5,0 as the tty device in /proc/<pid>/stat so
    it would list all processes on dptys as being run on /dev/tty...not the most
    useful solution. I was also considering possibly not adding the tty_driver
    structs to the actual tty_driver linked list. All the tables would be
    dynamically allocated with the tty_driver struct and would be created with
    only one entry.

    I was just wondering if anyone had any comments, suggestions, etc.,
    before I go implementing (I haven't done much deep kernel hacking in the
    past and the whole tty layout is just now beginning to somewhat make a
    little sense).

    FYI, this idea is not my own but was suggested to me by Alan Cox (I's been a while).

    Greg Alexander - also <> -
    "People are very flexible and learn to adjust to strange
    surroundings -- they can become accustomed to read Lisp and
    Fortran programs, for example."
    -- Leon Sterling and Ehud Shapiro, Art of Prolog, MIT Press

    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to

     \ /
      Last update: 2005-03-22 13:41    [W:0.018 / U:38.576 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site