]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
ioctl_tty.2: Fix includes
authorAlejandro Colomar <alx.manpages@gmail.com>
Mon, 10 May 2021 17:55:12 +0000 (19:55 +0200)
committerMichael Kerrisk <mtk.manpages@gmail.com>
Tue, 11 May 2021 05:18:08 +0000 (17:18 +1200)
<sys/ioctl.h> is needed for the prototype of ioctl().  That header
also provides most of the constants used by the function.  Only a
few of those constants are not provided by that header, and need
<termios.h>; clarify which constants do need that include.

......

$ <man2/ioctl_tty.2 \
  sed -n '/^.SH DESCRIPTION/,/^.SH/p' \
  |grep -e '^\.B' -e TIOCM \
  |sed 's/^\.B[^ ]* //' \
  |awk '{print $1}' \
  |grep '^[[:upper:]]' \
  |grep -v -e '^CAP' -e '^E' -e '^SIG' -e '^O_' -e '^[TR]XD$' -e '^POLL' \
  |sort \
  |uniq \
  |while read f; do \
find /usr/include/ -type f \
|xargs grep -l "define\s$f" \
|grep -q ioctl.*.h \
||echo $f \
|while read ff; do \
echo "============ $ff"; \
find /usr/include/ -type f \
|xargs grep -n "define\s$ff"; \
done; \
  done;
============ CLOCAL
/usr/include/asm-generic/termbits.h:142:#define CLOCAL 0004000
/usr/include/gphoto2/gphoto2-port-portability.h:127:#   define CLOCAL  0x00000800
/usr/include/x86_64-linux-gnu/bits/termios-c_cflag.h:34:#define CLOCAL 0004000
============ TCIFLUSH
/usr/include/asm-generic/termbits.h:191:#define TCIFLUSH 0
/usr/include/x86_64-linux-gnu/bits/termios.h:70:#define TCIFLUSH 0
============ TCIOFF
/usr/include/asm-generic/termbits.h:187:#define TCIOFF 2
/usr/include/x86_64-linux-gnu/bits/termios.h:66:#define TCIOFF 2
============ TCIOFLUSH
/usr/include/asm-generic/termbits.h:193:#define TCIOFLUSH 2
/usr/include/x86_64-linux-gnu/bits/termios.h:72:#define TCIOFLUSH 2
============ TCION
/usr/include/asm-generic/termbits.h:188:#define TCION 3
/usr/include/x86_64-linux-gnu/bits/termios.h:67:#define TCION 3
============ TCOFLUSH
/usr/include/asm-generic/termbits.h:192:#define TCOFLUSH 1
/usr/include/x86_64-linux-gnu/bits/termios.h:71:#define TCOFLUSH 1
============ TCOOFF
/usr/include/asm-generic/termbits.h:185:#define TCOOFF 0
/usr/include/x86_64-linux-gnu/bits/termios.h:64:#define TCOOFF 0
============ TCOON
/usr/include/asm-generic/termbits.h:186:#define TCOON 1
/usr/include/x86_64-linux-gnu/bits/termios.h:65:#define TCOON 1
============ TIOCREMOTE
============ TIOCSTART
============ TIOCSTOP
============ TIOCTTYGSTRUCT
============ TIOCUCNTL

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
man2/ioctl_tty.2

index badd58e50ed42f40eb2082b5d03d226cfc3092a7..c8269070180f9ac44dc1af58262aca2971c3bff4 100644 (file)
@@ -10,7 +10,9 @@
 ioctl_tty \- ioctls for terminals and serial lines
 .SH SYNOPSIS
 .nf
-.B "#include <termios.h>"
+.B #include <sys/ioctl.h>
+.BR "#include <termios.h>" "      /* Definition of " CLOCAL ", and"
+.BR    "                             TC*" { FLUSH , ON , OFF "} constants */"
 .PP
 .BI "int ioctl(int " fd ", int " cmd ", ...);"
 .fi
@@ -119,8 +121,6 @@ Window sizes are kept in the kernel, but not used by the kernel
 update the window size when the size of the virtual console changes,
 for example, by loading a new font).
 .PP
-The following constants and structure are defined in
-.IR <sys/ioctl.h> .
 .TP
 .B TIOCGWINSZ
 Argument: