From: "Michael Kerrisk (man-pages)" <mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Olivier TARTROU
<olivier.tartrou-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
libc-alpha-9JcytcrH/bA+uJoB2kUjGw@public.gmane.org
Subject: Re: [patch] termios.3: Add missing details on behaviour of PARMRK
Date: Wed, 02 Dec 2015 20:18:22 +0100 [thread overview]
Message-ID: <565F43FE.8060700@gmail.com> (raw)
In-Reply-To: <CAMEd9SiB39hjzue=P6m-nJhSAd5=PcnL3NtoG3S6f+iiLCwEbw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
Hello Olivier,
On 11/05/2015 10:38 PM, Olivier TARTROU wrote:
> For a serial terminal, with a specific configuration, input bytes with
> value 0377 are passed to the program as two bytes, 0377 0377.
>
> This (correct) behaviour is described in the documentation of the GNU
> C Library (https://www.gnu.org/software/libc/manual/html_node/Input-Modes.html#Input-Modes)
> but not in the termios.3 man page.
>
> Problematic configuration: INPCK set, IGNPAR not set, PARMRK set,
> ISTRIP not set.
>
> This man page problem affects several users. Examples:
> * http://sourceforge.net/p/ftdi-usb-sio/mailman/message/4079724/
> * http://mailman.uclinux.org/pipermail/uclinux-dev/2006-November/040984.html
> * ...
>
> The patch below corrects this problem. This patch applies to release 4.02.
Thanks. I confirm your point. Patch applied. Just a note though:
your mailer broke the patch (line-wrapping), and also "git am" didn't
work cleanly because of the way you generated the patch. But, otherwise
a nice patch have, so thanks again.
Cheers,
Michael
> --- old/termios.3 2015-11-04 20:32:56.117200840 +0100
> +++ new/termios.3 2015-11-04 23:31:23.165191198 +0100
> @@ -36,6 +36,8 @@
> .\" Added a section on canonical and noncanonical mode.
> .\" Enhanced the discussion of "raw" mode for cfmakeraw().
> .\" Document CMSPAR.
> +.\" 2015-11-04, Olivier TARTROU <olivier.tartrou-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:
> +.\" Reworked description of PARMRK from
> https://www.gnu.org/software/libc/manual/html_node/Input-Modes.html#Input-Modes
> .\"
> .TH TERMIOS 3 2015-03-02 "Linux" "Linux Programmer's Manual"
> .SH NAME
> @@ -133,8 +135,17 @@
> Ignore framing errors and parity errors.
> .TP
> .B PARMRK
> -If \fBIGNPAR\fP is not set, prefix a character with a parity error or
> -framing error with \\377 \\0.
> +If this bit is set, input bytes with parity or framing errors are
> +marked when passed to the program. This bit is meaningful only when
> +\fBINPCK\fP is set and \fBIGNPAR\fP is not set.
> +The way erroneous bytes are marked is with two preceding bytes,
> +\\377 and \\0. Thus, the program actually reads three bytes for one
> +erroneous byte received from the terminal.
> +If a valid byte has the value \\377, and \fBISTRIP\fP (see below) is
> +not set, the program might confuse it with the prefix that marks a
> +parity error. So a valid byte \\377 is passed to the program as two
> +bytes, \\377 \\377, in this case.
> +
> If neither \fBIGNPAR\fP nor \fBPARMRK\fP
> is set, read a character with a parity error or framing error
> as \\0.
>
>
> Best regards,
>
> Olivier TARTROU
>
--
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2015-12-02 19:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-05 21:38 [patch] termios.3: Add missing details on behaviour of PARMRK Olivier TARTROU
[not found] ` <CAMEd9SiB39hjzue=P6m-nJhSAd5=PcnL3NtoG3S6f+iiLCwEbw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-11-26 22:47 ` Olivier TARTROU
2015-12-02 19:18 ` Michael Kerrisk (man-pages) [this message]
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=565F43FE.8060700@gmail.com \
--to=mtk.manpages-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=libc-alpha-9JcytcrH/bA+uJoB2kUjGw@public.gmane.org \
--cc=linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=olivier.tartrou-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.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;
as well as URLs for NNTP newsgroup(s).