From: "Theodore Ts'o" <tytso@mit.edu>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Roman Zippel <zippel@linux-m68k.org>,
Andreas Schwab <schwab@suse.de>,
linux-kernel@vger.kernel.org
Subject: Re: Pty is losing bytes
Date: Wed, 16 Feb 2005 09:42:03 -0500 [thread overview]
Message-ID: <20050216144203.GB7767@thunk.org> (raw)
In-Reply-To: <Pine.LNX.4.58.0502151942530.2383@ppc970.osdl.org>
On Tue, Feb 15, 2005 at 08:05:05PM -0800, Linus Torvalds wrote:
> Why have that "tty->icanon && !tty->canon_data" test in the first place, I
> wonder? Isn't the "left" calculation always correct? That's really how
> many bytes free we have in the tty, that "canon_data" thing is just about
> how much of it is available for _reading_ as canon, no? (Ie "how many
> characters that have seen a finishing end-of-line"). So I don't see why
> that canon_data test is relevant to the question of filling the buffer..
The comment above the test explains why that test is there in
n_tty_receive_room. If that test isn't there, and we are doing input
canonicalization, when the buffer gets full, the low-level driver will
either flow control the source (so the ERASE or EOLN characters won't
get sent through) or the low-level driver will drop the characters
(and the line discpline will never see the ERASE or EOLN characters).
So the idea behind this code was to lie to the low-level driver, so
that the line discpline would always get the characters, and then the
line discpline could process ERASE, WERASE, KILL, or EOL, and drop the
rest on the floor. At least, that was the basic idea. Yes, it was a
kludge; no I'm not particularly proud of it.
The whole structure badly needs to be ripped apart and rewritten, but
unfortunately few employers seem to be willing to dedicate their
hackers' time to Do This Right. Sigh....
- Ted
next prev parent reply other threads:[~2005-02-16 14:43 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-15 0:54 Pty is losing bytes Andreas Schwab
2005-02-15 19:08 ` Linus Torvalds
2005-02-15 19:44 ` Linus Torvalds
2005-02-15 22:13 ` Alan Cox
2005-02-15 19:58 ` Sergey Vlasov
2005-02-15 20:13 ` Sergey Vlasov
2005-02-15 20:06 ` Alan Curry
2005-02-15 20:30 ` Andreas Schwab
2005-02-15 20:56 ` Linus Torvalds
2005-02-15 21:54 ` Andreas Schwab
2005-02-16 3:12 ` Roman Zippel
2005-02-16 4:05 ` Linus Torvalds
2005-02-16 14:42 ` Theodore Ts'o [this message]
2005-02-16 16:06 ` Linus Torvalds
2005-02-17 4:44 ` Theodore Ts'o
2005-02-17 15:45 ` Linus Torvalds
2005-02-18 16:32 ` Theodore Ts'o
2005-02-16 19:49 ` Roman Zippel
2005-02-16 19:58 ` Linus Torvalds
2005-02-16 22:46 ` Andrew Morton
-- strict thread matches above, loose matches on Subject: below --
2005-02-15 2:00 Alex Davis
2005-02-15 10:48 ` Andreas Schwab
2005-02-15 11:01 ` Jan De Luyck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050216144203.GB7767@thunk.org \
--to=tytso@mit.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=schwab@suse.de \
--cc=torvalds@osdl.org \
--cc=zippel@linux-m68k.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox