]> git.ozlabs.org Git - ppp.git/commit - pppd/termios_linux.h
pppd: Fix usage of BOTHER ioctl API on Linux (#314)
authorpali <7141871+pali@users.noreply.github.com>
Mon, 27 Sep 2021 07:10:31 +0000 (09:10 +0200)
committerGitHub <noreply@github.com>
Mon, 27 Sep 2021 07:10:31 +0000 (17:10 +1000)
commitb21711c71f2bf9537f5985339cf6e224738315ef
treefeb524c9e036bdb4f2e5c2be58c6e56351833d98
parent7adcfc961d3ccb051da87cc95d76cd3344f00fb8
pppd: Fix usage of BOTHER ioctl API on Linux (#314)

Linux architectures have different content of struct termios2 and also
different value of BOTHER macro. So do not declare any struct termios2 nor
BOTHER macro. Current definitions in ppp were applicable only for x86.

Correct definitions for current architecture are only in <asm/termbits.h>
and <asm/ioctls.h> header files. But Linux header file <asm/termbits.h> is
in conflict with glibc header file <termios.h> and only one can be included
in one source unit. Moreover both header files contains struct termios but
with different content. So it is not possible to use glibc tc* functions
with <asm/termbits.h> definitions.

For this reason provide a new include header file "termios_linux.h" which
provides custom implementation of all glibc's termios.h functions via Linux
ioctl() interface with definitions from Linux <asm/termbits.h> header file.

Thus this "termios_linux.h" is replacement for <termios.h> with additional
support for BOTHER Linux termios API.

Same "termios_linux.h" is going to be used by U-Boot's kwboot utility for
the same reason to use arbitrary baudrate value via BOTHER ioctl API.

Hopefully one day glibc will provide some API functions for functionality
provided currently by BOTHER Linux API.

Signed-off-by: Pali Rohár <pali@kernel.org>
pppd/Makefile.am
pppd/sys-linux.c
pppd/termios_linux.h [new file with mode: 0644]