]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
termios: Consolidate termios.h
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 9 Oct 2018 21:57:53 +0000 (18:57 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 3 Jan 2019 11:32:12 +0000 (09:32 -0200)
This patch consolidates the Linux termios.h by removing the arch-specific
one.

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/Makefile (sysdep_headers): Add
bits/termios-misc.h.
* sysdeps/unix/sysv/linux/alpha/bits/termios.h: Remove file.
* sysdeps/unix/sysv/linux/mips/bits/termios.h: Likewise.
* sysdeps/unix/sysv/linux/sparc/bits/termios.h: Likewise.
* sysdeps/unix/sysv/linux/powerpc/bits/termios.h: Likewise.
* sysdeps/unix/sysv/linux/bits/termios-misc.h: New file.
* sysdeps/unix/sysv/linux/bits/termios.h: Include termios-misc.h.

ChangeLog
sysdeps/unix/sysv/linux/Makefile
sysdeps/unix/sysv/linux/alpha/bits/termios.h [deleted file]
sysdeps/unix/sysv/linux/bits/termios-misc.h [new file with mode: 0644]
sysdeps/unix/sysv/linux/bits/termios.h
sysdeps/unix/sysv/linux/mips/bits/termios.h [deleted file]
sysdeps/unix/sysv/linux/powerpc/Makefile
sysdeps/unix/sysv/linux/powerpc/bits/termios.h [deleted file]
sysdeps/unix/sysv/linux/sparc/bits/termios.h [deleted file]

index 77275a1a019448340699b3c54f4ce1f0a1974f0d..c446abcd4e708a207201d6f0f71a9dc160b58131 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2019-01-03  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
 
+       * sysdeps/unix/sysv/linux/Makefile (sysdep_headers): Add
+       bits/termios-misc.h.
+       * sysdeps/unix/sysv/linux/alpha/bits/termios.h: Remove file.
+       * sysdeps/unix/sysv/linux/mips/bits/termios.h: Likewise.
+       * sysdeps/unix/sysv/linux/sparc/bits/termios.h: Likewise.
+       * sysdeps/unix/sysv/linux/powerpc/bits/termios.h: Likewise.
+       * sysdeps/unix/sysv/linux/bits/termios-misc.h: New file.
+       * sysdeps/unix/sysv/linux/bits/termios.h: Include termios-misc.h.
+
        * sysdeps/unix/sysv/linux/powerpc/bits/termios-misc.h: New file.
        * sysdeps/unix/sysv/linux/powerpc/bits/termios.h [__USE_MISC]
        (struct sgtty, struct tchars, struct ltchars, TIOCPKT_DATA,
index feddcab688e3781e59fa5df9818816e9c14814c7..5f8c2c7c7dac9e3b61c9389ab2c11e964f70ecc3 100644 (file)
@@ -47,7 +47,8 @@ sysdep_headers += sys/mount.h sys/acct.h sys/sysctl.h \
                  bits/termios-struct.h bits/termios-c_cc.h \
                  bits/termios-c_iflag.h bits/termios-c_oflag.h \
                  bits/termios-baud.h bits/termios-c_cflag.h \
-                 bits/termios-c_lflag.h bits/termios-tcflow.h
+                 bits/termios-c_lflag.h bits/termios-tcflow.h \
+                 bits/termios-misc.h
 
 tests += tst-clone tst-clone2 tst-clone3 tst-fanotify tst-personality \
         tst-quota tst-sync_file_range tst-sysconf-iov_max tst-ttyname \
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/termios.h b/sysdeps/unix/sysv/linux/alpha/bits/termios.h
deleted file mode 100644 (file)
index 24b2c52..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-/* termios type and macro definitions.  Linux version.
-   Copyright (C) 1993-2019 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
-   <http://www.gnu.org/licenses/>.  */
-
-#ifndef _TERMIOS_H
-# error "Never include <bits/termios.h> directly; use <termios.h> instead."
-#endif
-
-typedef unsigned char  cc_t;
-typedef unsigned int   speed_t;
-typedef unsigned int   tcflag_t;
-
-#include <bits/termios-struct.h>
-#include <bits/termios-c_cc.h>
-#include <bits/termios-c_iflag.h>
-#include <bits/termios-c_oflag.h>
-
-/* c_cflag bit meaning */
-#define  B0    0000000         /* hang up */
-#define  B50   0000001
-#define  B75   0000002
-#define  B110  0000003
-#define  B134  0000004
-#define  B150  0000005
-#define  B200  0000006
-#define  B300  0000007
-#define  B600  0000010
-#define  B1200 0000011
-#define  B1800 0000012
-#define  B2400 0000013
-#define  B4800 0000014
-#define  B9600 0000015
-#define  B19200        0000016
-#define  B38400        0000017
-#ifdef __USE_MISC
-# define EXTA B19200
-# define EXTB B38400
-#endif
-#include <bits/termios-baud.h>
-
-#include <bits/termios-c_cflag.h>
-#include <bits/termios-c_lflag.h>
-
-/* Values for the ACTION argument to `tcflow'.  */
-#define        TCOOFF          0
-#define        TCOON           1
-#define        TCIOFF          2
-#define        TCION           3
-
-/* Values for the QUEUE_SELECTOR argument to `tcflush'.  */
-#define        TCIFLUSH        0
-#define        TCOFLUSH        1
-#define        TCIOFLUSH       2
-
-#include <bits/termios-tcflow.h>
diff --git a/sysdeps/unix/sysv/linux/bits/termios-misc.h b/sysdeps/unix/sysv/linux/bits/termios-misc.h
new file mode 100644 (file)
index 0000000..8a151fa
--- /dev/null
@@ -0,0 +1,21 @@
+/* termios baud platform specific definitions.  Linux/generic version.
+   Copyright (C) 2019 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
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _TERMIOS_H
+# error "Never include <bits/termios-misc.h> directly; use <termios.h> instead."
+#endif
index 158f58b9f58cabcbb3bf9f187c09f8c213becfce..997231cd0380dab770a4976482b0f8a0b844c828 100644 (file)
@@ -72,3 +72,5 @@ typedef unsigned int  tcflag_t;
 #define        TCIOFLUSH       2
 
 #include <bits/termios-tcflow.h>
+
+#include <bits/termios-misc.h>
diff --git a/sysdeps/unix/sysv/linux/mips/bits/termios.h b/sysdeps/unix/sysv/linux/mips/bits/termios.h
deleted file mode 100644 (file)
index b024f5e..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-/* termios type and macro definitions.  Linux/MIPS version.
-   Copyright (C) 1993-2019 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
-   <http://www.gnu.org/licenses/>.  */
-
-#ifndef _TERMIOS_H
-# error "Never include <bits/termios.h> directly; use <termios.h> instead."
-#endif
-
-typedef unsigned char  cc_t;
-typedef unsigned int   speed_t;
-typedef unsigned int   tcflag_t;
-
-#include <bits/termios-struct.h>
-#include <bits/termios-c_cc.h>
-#include <bits/termios-c_iflag.h>
-#include <bits/termios-c_oflag.h>
-
-/* c_cflag bit meaning */
-#define  B0    0000000         /* hang up */
-#define  B50   0000001
-#define  B75   0000002
-#define  B110  0000003
-#define  B134  0000004
-#define  B150  0000005
-#define  B200  0000006
-#define  B300  0000007
-#define  B600  0000010
-#define  B1200 0000011
-#define  B1800 0000012
-#define  B2400 0000013
-#define  B4800 0000014
-#define  B9600 0000015
-#define  B19200        0000016
-#define  B38400        0000017
-#ifdef __USE_MISC
-# define EXTA B19200
-# define EXTB B38400
-#endif
-#include <bits/termios-baud.h>
-
-#include <bits/termios-c_cflag.h>
-#include <bits/termios-c_lflag.h>
-
-#ifdef __USE_MISC
-/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
-# define TIOCSER_TEMT    0x01  /* Transmitter physically empty */
-#endif
-
-/* tcflow() and TCXONC use these */
-#define        TCOOFF          0       /* Suspend output.  */
-#define        TCOON           1       /* Restart suspended output.  */
-#define        TCIOFF          2       /* Send a STOP character.  */
-#define        TCION           3       /* Send a START character.  */
-
-/* tcflush() and TCFLSH use these */
-#define        TCIFLUSH        0       /* Discard data received but not yet read.  */
-#define        TCOFLUSH        1       /* Discard data written but not yet sent.  */
-#define        TCIOFLUSH       2       /* Discard all pending data.  */
-
-#include <bits/termios-tcflow.h>
index 7712428e104a6f31e863980dc0383d8791d03910..19ac59d8620bcec050b7b886e09edccbb2baca93 100644 (file)
@@ -23,7 +23,7 @@ LDFLAGS-tst-tlsmod2.so += -Wl,--no-tls-get-addr-optimize
 endif
 
 ifeq ($(subdir),misc)
-sysdep_headers += bits/ppc.h bits/termios-misc.h
+sysdep_headers += bits/ppc.h
 sysdep_routines += get_timebase_freq
 tests += test-gettimebasefreq
 tests += test-powerpc-linux-sysconf
diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/termios.h b/sysdeps/unix/sysv/linux/powerpc/bits/termios.h
deleted file mode 100644 (file)
index fea7965..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-/* Copyright (C) 1997-2019 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
-   <http://www.gnu.org/licenses/>.  */
-
-#ifndef _TERMIOS_H
-# error "Never include <bits/termios.h> directly; use <termios.h> instead."
-#endif
-
-typedef unsigned char  cc_t;
-typedef unsigned int   speed_t;
-typedef unsigned int   tcflag_t;
-
-#include <bits/termios-struct.h>
-#include <bits/termios-c_cc.h>
-#include <bits/termios-c_iflag.h>
-#include <bits/termios-c_oflag.h>
-
-/* c_cflag bit meaning */
-#define  B0    0000000         /* hang up */
-#define  B50   0000001
-#define  B75   0000002
-#define  B110  0000003
-#define  B134  0000004
-#define  B150  0000005
-#define  B200  0000006
-#define  B300  0000007
-#define  B600  0000010
-#define  B1200 0000011
-#define  B1800 0000012
-#define  B2400 0000013
-#define  B4800 0000014
-#define  B9600 0000015
-#define  B19200        0000016
-#define  B38400        0000017
-#ifdef __USE_MISC
-# define EXTA B19200
-# define EXTB B38400
-#endif
-#include <bits/termios-baud.h>
-
-#include <bits/termios-c_cflag.h>
-#include <bits/termios-c_lflag.h>
-
-/* Values for the ACTION argument to `tcflow'.  */
-#define        TCOOFF          0
-#define        TCOON           1
-#define        TCIOFF          2
-#define        TCION           3
-
-/* Values for the QUEUE_SELECTOR argument to `tcflush'.  */
-#define        TCIFLUSH        0
-#define        TCOFLUSH        1
-#define        TCIOFLUSH       2
-
-#include <bits/termios-tcflow.h>
-
-#include <bits/termios-misc.h>
-
-#ifdef __USE_MISC
-/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
-# define TIOCSER_TEMT    0x01  /* Transmitter physically empty */
-#endif
-
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/termios.h b/sysdeps/unix/sysv/linux/sparc/bits/termios.h
deleted file mode 100644 (file)
index 71d3c6e..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-/* termios type and macro definitions.  Linux/SPARC version.
-   Copyright (C) 1993-2019 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
-   <http://www.gnu.org/licenses/>.  */
-
-#ifndef _TERMIOS_H
-# error "Never include <bits/termios.h> directly; use <termios.h> instead."
-#endif
-
-typedef unsigned char cc_t;
-typedef unsigned int speed_t;
-typedef unsigned int tcflag_t;
-
-#include <bits/termios-struct.h>
-#include <bits/termios-c_cc.h>
-#include <bits/termios-c_iflag.h>
-#include <bits/termios-c_oflag.h>
-
-/* c_cflag bit meaning */
-#define  B0    0x00000000      /* hang up */
-#define  B50   0x00000001
-#define  B75   0x00000002
-#define  B110  0x00000003
-#define  B134  0x00000004
-#define  B150  0x00000005
-#define  B200  0x00000006
-#define  B300  0x00000007
-#define  B600  0x00000008
-#define  B1200 0x00000009
-#define  B1800 0x0000000a
-#define  B2400 0x0000000b
-#define  B4800 0x0000000c
-#define  B9600 0x0000000d
-#define  B19200        0x0000000e
-#define  B38400        0x0000000f
-#ifdef __USE_MISC
-# define EXTA    B19200
-# define EXTB    B38400
-#endif
-#include <bits/termios-baud.h>
-
-#include <bits/termios-c_cflag.h>
-#include <bits/termios-c_lflag.h>
-
-#ifdef __USE_MISC
-/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
-# define TIOCSER_TEMT    0x01  /* Transmitter physically empty */
-#endif
-
-/* tcflow() and TCXONC use these */
-#define        TCOOFF          0
-#define        TCOON           1
-#define        TCIOFF          2
-#define        TCION           3
-
-/* tcflush() and TCFLSH use these */
-#define        TCIFLUSH        0
-#define        TCOFLUSH        1
-#define        TCIOFLUSH       2
-
-#include <bits/termios-tcflow.h>