From: Peter Hurley <peter@hurleysoftware.com>
To: mtk.manpages@gmail.com
Cc: linux kernel <linux-kernel@vger.kernel.org>,
linux-serial <linux-serial@vger.kernel.org>,
One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk>,
Ivan <athlon_@mail.ru>
Subject: Re: man termios
Date: Fri, 21 Mar 2014 12:11:13 -0400 [thread overview]
Message-ID: <532C64A1.6090807@hurleysoftware.com> (raw)
In-Reply-To: <CAKgNAkhRu7yZSn+uB1eTcL0gPGPcGsd5Z36pXgfdKOLBcdOoBw@mail.gmail.com>
On 03/21/2014 11:41 AM, Michael Kerrisk (man-pages) wrote:
>>> Peter, do you agree that Linux appears to differ from POSIX here? (Not
>>> sure if you tried my test program to verify...)
>>
>>
>> I did run the test program to validate that it's observed behavior is that
>> implemented by Linux, with which I'm very familiar.
>> I don't have a test setup for other *nixes.
>>
>> I would be interested to know the results of
>>
>> ./noncanonical 0 5 3 0
>> hello
>
> Solaris 10:
> read() completes when 5 bytes received.
> OpenBSD 5.4
> read() completes when 5 bytes received.
Ok, Linux does the same.
>> and
>>
>> ./noncanonical 0 5 3 2
>> hel
>
> Solaris
> read blocks()
> OpenBSD
> read blocks
If you type fast, Linux will complete this read() with 3 bytes.
> Plus my test case where Linux differs:
>
> ./noncanonical 100 5 3 0
>
> Linux: read() returns after 3 bytes input
>
> Solaris: read() returns only after 5 bytes input
> OpenBSD: read() returns only after 5 bytes input
Ok, thanks for testing.
>> on other platforms.
>>
>> With respect to POSIX compliance, it's hard to say. I'm not sure the
>> spec contemplates the degenerate case where max bytes < MIN. And
>
> Well, given the way the other implementations behave, I think it does
> contemplate it, because it carefull avoids talking about the number of
> bytes requested by read() in that case.
I agree that's certainly a valid interpretation.
I'll go back and see if this is a regression but I doubt it.
>> specifically
>> with regard to terminal i/o behavior, POSIX is essentially ex post facto,
>> and is really documenting existing behavior.
>>
>> Other than the degenerate case of max bytes < MIN, is there any other
>> variation between Solaris and Linux in non-canonical mode?
>
> The only one I've seen is the one I noted. I haven't tested too
> exhaustively though.
Thanks again. Please feel free to direct mail my way if you find other
variation.
Regards,
Peter Hurley
next prev parent reply other threads:[~2014-03-21 16:11 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-20 18:42 man termios Peter Hurley
2014-03-21 10:45 ` Michael Kerrisk (man-pages)
2014-03-21 11:21 ` Peter Hurley
2014-03-21 13:15 ` Michael Kerrisk (man-pages)
2014-03-21 14:03 ` Peter Hurley
2014-03-21 14:17 ` Michael Kerrisk (man-pages)
2014-03-21 14:51 ` Peter Hurley
2014-03-21 15:41 ` Michael Kerrisk (man-pages)
2014-03-21 16:11 ` Peter Hurley [this message]
2014-03-21 18:45 ` Michael Kerrisk (man-pages)
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=532C64A1.6090807@hurleysoftware.com \
--to=peter@hurleysoftware.com \
--cc=athlon_@mail.ru \
--cc=gnomes@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=mtk.manpages@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).