Pali Rohár 634aa8e586 tools: termios_linux.h: Fix compilation on non-glibc systems
TCGETS2 is defined in header file asm/ioctls.h provided by linux kernel.
On glib systems it is automatically included by some other glibc include
header file and therefore TCGETS2 is present in termios_linux.h when
linux kernel provides it.

On non-glibc systems (e.g. musl) asm/ioctls.h is not automatically included
which results in the strange error that BOTHER is supported, TCGETS2 not
defined and struct termios does not provide c_ispeed member.

    tools/kwboot.c: In function 'kwboot_tty_change_baudrate':
    tools/kwboot.c:662:6: error: 'struct termios' has no member named 'c_ospeed'
      662 |   tio.c_ospeed = tio.c_ispeed = baudrate;
          |      ^

Fix this issue by explicitly including asm/ioctls.h file which provides
TCGETS2 macro (if supported on selected architecture) to not depending on
glibc auto-include behavior and because termios_linux.h requires it.

With this change it is possible compile kwboot with musl libc.

Reported-by: Michal Vasilek <michal.vasilek@nic.cz>
Signed-off-by: Pali Rohár <pali@kernel.org>
2022-09-13 06:38:08 +02:00
..
2022-09-12 06:41:14 -06:00
2022-04-19 14:51:11 -04:00
2021-01-13 02:38:00 +01:00
2022-01-19 18:11:34 +01:00
2022-01-28 17:58:41 -05:00
2022-07-26 11:29:02 +02:00
2022-07-13 20:05:49 +02:00
2022-01-19 18:11:34 +01:00
2019-11-04 18:15:32 -07:00