diff options
author | H. Peter Anvin (Intel) <hpa@zytor.com> | 2025-06-11 18:35:40 -0700 |
---|---|---|
committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2025-06-17 09:11:38 -0300 |
commit | ad37ecd5791dbb47844b58574f32ab1ef2739275 (patch) | |
tree | 2cdb31d51e0f1cf347f8606f81201848fef86e7b /sysdeps/unix/sysv | |
parent | bbbaf50b2a340d6913b8ad8a840dd2d66874c62b (diff) | |
download | glibc-ad37ecd5791dbb47844b58574f32ab1ef2739275.zip glibc-ad37ecd5791dbb47844b58574f32ab1ef2739275.tar.gz glibc-ad37ecd5791dbb47844b58574f32ab1ef2739275.tar.bz2 |
termios: merge the termios baud definitions
Now all platforms unconditionally use the "sane" definitions of the
termios baud constants. Unify them into a common file.
Note: I have made them explicitly unsigned to avoid problems with
compiler warnings for comparisons of unequal signedness or
similar. These constants were historically octal on most platforms,
and so unsigned by default.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Diffstat (limited to 'sysdeps/unix/sysv')
-rw-r--r-- | sysdeps/unix/sysv/linux/Makefile | 1 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/bits/termios-baud.h | 63 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/bits/termios.h | 6 |
3 files changed, 3 insertions, 67 deletions
diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile index ebcf820..a14b8c1 100644 --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -151,7 +151,6 @@ sysdep_headers += \ bits/struct_stat.h \ bits/struct_stat_time64_helper.h \ bits/syscall.h \ - bits/termios-baud.h \ bits/termios-c_cc.h \ bits/termios-c_cflag.h \ bits/termios-c_iflag.h \ diff --git a/sysdeps/unix/sysv/linux/bits/termios-baud.h b/sysdeps/unix/sysv/linux/bits/termios-baud.h deleted file mode 100644 index 1e41338..0000000 --- a/sysdeps/unix/sysv/linux/bits/termios-baud.h +++ /dev/null @@ -1,63 +0,0 @@ -/* termios baud rate selection definitions. Linux/generic version. - Copyright (C) 2019-2025 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - <https://www.gnu.org/licenses/>. */ - -#ifndef _TERMIOS_H -# error "Never include <bits/termios-baud.h> directly; use <termios.h> instead." -#endif - -#define B0 0U -#define B50 50U -#define B75 75U -#define B110 110U -#define B134 134U -#define B150 150U -#define B200 200U -#define B300 300U -#define B600 600U -#define B1200 1200U -#define B1800 1800U -#define B2400 2400U -#define B4800 4800U -#define B7200 7200U -#define B9600 9600U -#define B14400 14400U -#define B19200 19200U -#define B28800 28800U -#define B33600 33600U -#define B38400 38400U -#define B57600 57600U -#define B76800 76800U -#define B115200 115200U -#define B153600 153600U -#define B230400 230400U -#define B307200 307200U -#define B460800 460800U -#define B500000 500000U -#define B576000 576000U -#define B614400 614400U -#define B921600 921600U -#define B1000000 1000000U -#define B1152000 1152000U -#define B1500000 1500000U -#define B2000000 2000000U -#define B2500000 2500000U -#define B3000000 3000000U -#define B3500000 3500000U -#define B4000000 4000000U - -#define __MAX_BAUD 4294967295U diff --git a/sysdeps/unix/sysv/linux/bits/termios.h b/sysdeps/unix/sysv/linux/bits/termios.h index 14de3fc..20746a0 100644 --- a/sysdeps/unix/sysv/linux/bits/termios.h +++ b/sysdeps/unix/sysv/linux/bits/termios.h @@ -35,6 +35,7 @@ typedef unsigned int tcflag_t; /* c_cflag bit meaning */ #include <bits/termios-c_cflag.h> +#ifdef __USE_MISC #define __B0 0000000 /* hang up */ #define __B50 0000001 #define __B75 0000002 @@ -53,9 +54,8 @@ typedef unsigned int tcflag_t; #define __B38400 0000017 #include <bits/termios-cbaud.h> -#ifdef __USE_MISC -# define EXTA __B19200 -# define EXTB __B38400 +# define __EXTA __B19200 +# define __EXTB __B38400 # define BOTHER __BOTHER #endif |