unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: "Pali Rohár via Libc-alpha" <libc-alpha@sourceware.org>
To: linux-man@vger.kernel.org,
	Alejandro Colomar <alx.manpages@gmail.com>,
	Michael Kerrisk <mtk.manpages@gmail.com>
Cc: "Marek Behún" <kabel@kernel.org>,
	"G. Branden Robinson" <g.branden.robinson@gmail.com>,
	libc-alpha@sourceware.org
Subject: [PATCH v2] ioctl_tty.2: Fix information about header include file
Date: Fri, 30 Jul 2021 15:05:37 +0200	[thread overview]
Message-ID: <20210730130537.18863-1-pali@kernel.org> (raw)
In-Reply-To: <20210730105353.10424-1-pali@kernel.org>

Header file termios.h contains incompatible definitions for linux ioctl
calls. Correct definitions are exported by header file linux/termios.h but
this file conflicts with sys/ioctl.h header file (required for ioctl()
call). Therefore include direct asm header file asm/termbits.h which
contains compatible definitions and structures for ioctl calls.

Signed-off-by: Pali Rohár <pali@kernel.org>

---
Changes in v2:
* Reformat SYNOPSIS for 80 chars per line
---
 man2/ioctl_tty.2 | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/man2/ioctl_tty.2 b/man2/ioctl_tty.2
index 771a9a470bf0..ecbae4f887c4 100644
--- a/man2/ioctl_tty.2
+++ b/man2/ioctl_tty.2
@@ -11,8 +11,10 @@ ioctl_tty \- ioctls for terminals and serial lines
 .SH SYNOPSIS
 .nf
 .B #include <sys/ioctl.h>
-.BR "#include <termios.h>" "      /* Definition of " CLOCAL ", and"
-.BR    "                             TC*" { FLUSH , ON , OFF "} constants */"
+.BR "#include <asm/termbits.h>" "   /* Definition of " "struct termios" ,
+.BR    "                               struct termios2" ", and"
+.BR    "                               Bnn" ", " BOTHER ", " CBAUD ", " CLOCAL ,
+.BR    "                               TC*" { FLUSH , ON , OFF "} and other constants */"
 .PP
 .BI "int ioctl(int " fd ", int " cmd ", ...);"
 .fi
@@ -31,6 +33,19 @@ makes for nonportable programs.
 Use the POSIX interface described in
 .BR termios (3)
 whenever possible.
+.PP
+Please note that
+.B struct termios
+from
+.B #include <asm/termbits.h>
+is different and incompatible with
+.B struct termios
+from
+.BR "#include <termios.h>" .
+These ioctl calls require
+.B struct termios
+from
+.BR "#include <asm/termbits.h>" .
 .SS Get and set terminal attributes
 .TP
 .B TCGETS
-- 
2.20.1


  parent reply	other threads:[~2021-07-30 13:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-30 10:53 [PATCH] ioctl_tty.2: Fix information about header include file Pali Rohár via Libc-alpha
2021-07-30 12:02 ` Alejandro Colomar (man-pages) via Libc-alpha
2021-07-30 13:05 ` Pali Rohár via Libc-alpha [this message]
2021-08-08  8:26   ` [PATCH v2] " Alejandro Colomar (man-pages) via Libc-alpha
2021-08-31 20:28     ` [PATCH v3] " Pali Rohár via Libc-alpha
2021-09-10 17:39       ` Pali Rohár via Libc-alpha
2021-09-10 19:47         ` Alejandro Colomar (man-pages) via Libc-alpha

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

  List information: https://www.gnu.org/software/libc/involved.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210730130537.18863-1-pali@kernel.org \
    --to=libc-alpha@sourceware.org \
    --cc=alx.manpages@gmail.com \
    --cc=g.branden.robinson@gmail.com \
    --cc=kabel@kernel.org \
    --cc=linux-man@vger.kernel.org \
    --cc=mtk.manpages@gmail.com \
    --cc=pali@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).