On Tue, Sep 24, 2002 at 08:14:27PM +0400, egor duda wrote: > Hi! > > Tuesday, 24 September, 2002 Steve O [EMAIL PROTECTED] wrote: > > SO> I was thinking about the deadlock problem some more last night, > SO> and it occured to me that if termios processing were done on > SO> the slave side, some of the buffering and tricky bits of > SO> flushing the write buffer would go away (maybe). And you wouldn't > SO> need this patch. > > What do you mean exactly by "termios processing"?
fhandler_termios::line_edit which is currently called by fhandler_pty_master::write could be instead called when the slave either selects or reads. Some modification would be needed. > And did you take into account the possibility that process which owns > slave side of tty forks and child gets handle to slave too. Then child > does some "termios processing". Will parent use old or new termios > settings? In my limited understand of this code, the line_edit processing handles cooking the data for the child. What settings to use would depend on what the child requests. The parent doesn't seem to be involved. My area of fuzziness in this is what happens when the child forks and both children select on reading the tty. In order to know if there's something to be read the select has to run the line_edit processing and check the readahead buffer. The result being that one child would return from select and the other wouldn't. The readahead buffer could be shared if this is indeed a problem. -steve
