mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "David L" <idht4n@hotmail.com>
To: linux-kernel@vger.kernel.org
Subject: serial port canonical mode weirdness?
Date: Wed, 31 Mar 2004 16:44:32 -0800	[thread overview]
Message-ID: <BAY2-F51LDp7mvjkO2200021e67@hotmail.com> (raw)

When I configure a serial port for canonical mode (newtio.c_lflag = ICANON),
I get behavior that isn't what I'd expect.  If I send >4095 characters that 
don't
contain an end-of-line and then an end of line, the number of characters 
read
is 1.  If I then start sending shorter lines, one character is read for each
end-of-line that is sent.  For example, if the limit was 10 instead of 4096, 
if the
received data was:

0123456789\n

The data returned by the driver would be:

0

(I would expect 0123456789\n to be returned)

Then if you send "A\n"
The data returned will be "1"

Then if you send "B\n"
The data returned will be "2"

And so on.

When it's in this state and you send "\n\n", it returns 4096 characters
and then starts acting like I would expect again.

I've also found that when it's in this state and you send
a few lines in rapid succession, the call to read will return 0
bytes and never returns any more good data.

Is this a kernel bug or an ignorant user?  I might expect some
data to be lost if a buffer overruns, but I didn't expect this behavior.

Thanks:

                                           David

_________________________________________________________________
MSN Toolbar provides one-click access to Hotmail from any Web page – FREE 
download! http://toolbar.msn.com/go/onm00200413ave/direct/01/


             reply	other threads:[~2004-04-01  0:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-01  0:44 David L [this message]
2004-04-01  8:28 ` Russell King
2004-04-02 22:02 ` Russell King
2004-04-01 15:45 David L

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=BAY2-F51LDp7mvjkO2200021e67@hotmail.com \
    --to=idht4n@hotmail.com \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®