]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
termios: unify the naming of the termios speed fields
authorH. Peter Anvin (Intel) <hpa@zytor.com>
Thu, 12 Jun 2025 01:35:43 +0000 (18:35 -0700)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 17 Jun 2025 12:11:38 +0000 (09:11 -0300)
The generic code has __ispeed and __ospeed; Linux has c_ispeed and
c_ospeed. Use an anonymous union member to allow both set of names on
all platforms.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
bits/termios.h
sysdeps/unix/sysv/linux/alpha/bits/termios-struct.h
sysdeps/unix/sysv/linux/bits/termios-struct.h

index 8f0b817dbf4ca3a7c179abf5c2324cc013589cbf..798012cb8ebcd2a9b11ca2de998a136431d41999 100644 (file)
@@ -286,7 +286,16 @@ struct termios
   cc_t c_cc[NCCS];
 
   /* Input and output baud rates.  */
-  speed_t __ispeed, __ospeed;
+  __extension__ union {
+    speed_t __ispeed;
+    speed_t c_ispeed;
+  };
+#define _HAVE_STRUCT_TERMIOS_C_ISPEED 1
+  __extension__ union {
+    speed_t __ospeed;
+    speed_t c_ospeed;
+  };
+#define _HAVE_STRUCT_TERMIOS_C_OSPEED 1
 };
 
 #define _IOT_termios /* Hurd ioctl type field.  */ \
index de4d5fc0ed017891dd7b89924327bd00eb5adc3b..f50e9ef6e34fae6b3aeab38acebbd6e9ae7eb846 100644 (file)
@@ -30,8 +30,15 @@ struct termios
     tcflag_t c_lflag;          /* local mode flags */
     cc_t c_cc[NCCS];           /* control characters */
     cc_t c_line;               /* line discipline (== c_cc[33]) */
-    speed_t c_ispeed;          /* input speed */
-    speed_t c_ospeed;          /* output speed */
+    /* Input and output baud rates.  */
+    __extension__ union {
+      speed_t __ispeed;
+      speed_t c_ispeed;
+    };
 #define _HAVE_STRUCT_TERMIOS_C_ISPEED 1
+    __extension__ union {
+      speed_t __ospeed;
+      speed_t c_ospeed;
+    };
 #define _HAVE_STRUCT_TERMIOS_C_OSPEED 1
   };
index 4c501a54b058628eb355ace306e45467c65e72c2..0aba1a446e73d56e7939de0dcf7aef7f6a171d44 100644 (file)
@@ -29,8 +29,15 @@ struct termios
     tcflag_t c_lflag;          /* local mode flags */
     cc_t c_line;                       /* line discipline */
     cc_t c_cc[NCCS];           /* control characters */
-    speed_t c_ispeed;          /* input speed */
-    speed_t c_ospeed;          /* output speed */
+    /* Input and output baud rates.  */
+    __extension__ union {
+      speed_t __ispeed;
+      speed_t c_ispeed;
+    };
 #define _HAVE_STRUCT_TERMIOS_C_ISPEED 1
+    __extension__ union {
+      speed_t __ospeed;
+      speed_t c_ospeed;
+    };
 #define _HAVE_STRUCT_TERMIOS_C_OSPEED 1
   };