diff options
author | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2018-10-09 10:00:14 -0300 |
---|---|---|
committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2019-01-03 09:32:12 -0200 |
commit | e5a50db36eaa6e8c6427b3a971563240b633ca85 (patch) | |
tree | 1fd926d4a122add2a014c07af558c9e786f941fb /sysdeps/unix/sysv/linux/tcgetattr.c | |
parent | 8083afa55d8c68abc02902e9a6ff16be5f301940 (diff) | |
download | glibc-e5a50db36eaa6e8c6427b3a971563240b633ca85.tar.gz glibc-e5a50db36eaa6e8c6427b3a971563240b633ca85.tar.xz glibc-e5a50db36eaa6e8c6427b3a971563240b633ca85.zip |
termios: Consolidate struct termios
This patch consolidates the struct termios definition on its own header and adds arch-defined ones for ABIs that deviate from generic implementation. They are: - alpha which has a slight different layout than generic one (c_cc field is defined prior c_line). - sparc and mips which do not have the c_ispeed/c_ospeed fields. No semantic change is expected, checked on a build against x86_64-linux-gnu, alpha-linux-gnu, mips64-linux-gnu, and sparc64-linux-gnu. * sysdeps/unix/sysv/linux/alpha/bits/termios-struct.h: New file. * sysdeps/unix/sysv/linux/bits/termios-struct.h: Likewise. * sysdeps/unix/sysv/linux/mips/bits/termios-struct.h: Likewise. * sysdeps/unix/sysv/linux/sparc/bits/termios-struct.h: Likewise. * sysdeps/unix/sysv/linux/Makefile (sysdep_headers): Add termios-struct.h. * sysdeps/unix/sysv/linux/bits/termios.h (struct termios): Move to termios-struct.h. * sysdeps/unix/sysv/linux/alpha/bits/termios.h (struct termios): Likewise. * sysdeps/unix/sysv/linux/mips/bits/termios.h (struct termios): Likewise. * sysdeps/unix/sysv/linux/powerpc/bits/termios.h (struct termios): Likewise. * sysdeps/unix/sysv/linux/sparc/bits/termios.h (struct termios): Likewise. * sysdeps/unix/sysv/linux/kernel_termios.h (_HAVE_C_ISPEED, _HAVE_C_OSPEED): Define. * sysdeps/unix/sysv/linux/mips/kernel_termios.h (_HAVE_C_ISPEED, _HAVE_C_OSPEED): Likewise. * sysdeps/unix/sysv/linux/sparc/kernel_termios.h (_HAVE_C_ISPEED, _HAVE_C_OSPEED): Likewise. * sysdeps/unix/sysv/linux/speed.c [_HAVE_STRUCT_TERMIOS_C_OSPEED] (cfsetospeed): Check for define value instead of existence. [_HAVE_STRUCT_TERMIOS_C_ISPEED] (cfsetispeed): Likewise. * sysdeps/unix/sysv/linux/tcgetattr.c [_HAVE_STRUCT_TERMIOS_C_ISPEED && _HAVE_C_ISPEED] (__tcgetattr): Likewise. * sysdeps/unix/sysv/linux/tcsetattr.c [_HAVE_STRUCT_TERMIOS_C_ISPEED && _HAVE_C_ISPEED] (__tcsetattr): Likewise.
Diffstat (limited to 'sysdeps/unix/sysv/linux/tcgetattr.c')
-rw-r--r-- | sysdeps/unix/sysv/linux/tcgetattr.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sysdeps/unix/sysv/linux/tcgetattr.c b/sysdeps/unix/sysv/linux/tcgetattr.c index f933fe6a51..c0f810207f 100644 --- a/sysdeps/unix/sysv/linux/tcgetattr.c +++ b/sysdeps/unix/sysv/linux/tcgetattr.c @@ -44,15 +44,15 @@ __tcgetattr (int fd, struct termios *termios_p) termios_p->c_cflag = k_termios.c_cflag; termios_p->c_lflag = k_termios.c_lflag; termios_p->c_line = k_termios.c_line; -#ifdef _HAVE_STRUCT_TERMIOS_C_ISPEED -# ifdef _HAVE_C_ISPEED +#if _HAVE_STRUCT_TERMIOS_C_ISPEED +# if _HAVE_C_ISPEED termios_p->c_ispeed = k_termios.c_ispeed; # else termios_p->c_ispeed = k_termios.c_cflag & (CBAUD | CBAUDEX); # endif #endif -#ifdef _HAVE_STRUCT_TERMIOS_C_OSPEED -# ifdef _HAVE_C_OSPEED +#if _HAVE_STRUCT_TERMIOS_C_OSPEED +# if _HAVE_C_OSPEED termios_p->c_ospeed = k_termios.c_ospeed; # else termios_p->c_ospeed = k_termios.c_cflag & (CBAUD | CBAUDEX); |