]> sourceware.org Git - glibc.git/commitdiff
termios: Consolidate tcflow symbolic constants
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 9 Oct 2018 18:54:16 +0000 (15:54 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 3 Jan 2019 11:32:12 +0000 (09:32 -0200)
This patch consolidates the termios symbolic constants for use with tcflow
in its own header.  The Linux generic implementation values match the
kernel UAPI and each architecture with deviate values have their own
implementation (currently only mips).

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
termios-tcflow.h.
* sysdeps/unix/sysv/linux/bits/termios-tcflow.h: New file.
* sysdeps/unix/sysv/linux/mips/bits/termios-tcflow.h: Likewise.
* sysdeps/unix/sysv/linux/bits/termios.h (TCSANOW, TCSADRAIN,
TCSAFLUSH): Move to termios-tcflow.h.
* sysdeps/unix/sysv/linux/alpha/bits/termios.h: Likewise.
* sysdeps/unix/sysv/linux/mips/bits/termios.h: Likewise.
* sysdeps/unix/sysv/linux/powerpc/bits/termios.h: Likewise.
* sysdeps/unix/sysv/linux/sparc/bits/termios.h: Likewise.

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

index d9eb67433fce5e72ccb6214c69142fa99e8c151a..c6c1d2c4b5fa984933605b4bb694be9dbccd8fa6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
 2019-01-03  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
 
+       * sysdeps/unix/sysv/linux/Makefile (sysdep_headers): Add
+       termios-tcflow.h.
+       * sysdeps/unix/sysv/linux/bits/termios-tcflow.h: New file.
+       * sysdeps/unix/sysv/linux/mips/bits/termios-tcflow.h: Likewise.
+       * sysdeps/unix/sysv/linux/bits/termios.h (TCSANOW, TCSADRAIN,
+       TCSAFLUSH): Move to termios-tcflow.h.
+       * sysdeps/unix/sysv/linux/alpha/bits/termios.h: Likewise.
+       * sysdeps/unix/sysv/linux/mips/bits/termios.h: Likewise.
+       * sysdeps/unix/sysv/linux/powerpc/bits/termios.h: Likewise.
+       * sysdeps/unix/sysv/linux/sparc/bits/termios.h: Likewise.
+
        * sysdeps/unix/sysv/linux/Makefile (sysdep_headers): Add
        termios-c_lflag.h.
        * sysdeps/unix/sysv/linux/bits/termios-c_lflag.h: New file.
index bd17a574bae369d2459e4a8bc334907a7f9aee20..feddcab688e3781e59fa5df9818816e9c14814c7 100644 (file)
@@ -47,7 +47,7 @@ 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-c_lflag.h bits/termios-tcflow.h
 
 tests += tst-clone tst-clone2 tst-clone3 tst-fanotify tst-personality \
         tst-quota tst-sync_file_range tst-sysconf-iov_max tst-ttyname \
index 95e40d8000f1ed7b099439fbe74fc895d043c334..fc47547e22bf0c0a14f420540e177f43cc2ece17 100644 (file)
@@ -66,11 +66,7 @@ typedef unsigned int tcflag_t;
 #define        TCOFLUSH        1
 #define        TCIOFLUSH       2
 
-/* Values for the OPTIONAL_ACTIONS argument to `tcsetattr'.  */
-#define        TCSANOW         0
-#define        TCSADRAIN       1
-#define        TCSAFLUSH       2
-
+#include <bits/termios-tcflow.h>
 
 #define _IOT_termios /* Hurd ioctl type field.  */ \
   _IOT (_IOTS (cflag_t), 4, _IOTS (cc_t), NCCS, _IOTS (speed_t), 2)
diff --git a/sysdeps/unix/sysv/linux/bits/termios-tcflow.h b/sysdeps/unix/sysv/linux/bits/termios-tcflow.h
new file mode 100644 (file)
index 0000000..3832d50
--- /dev/null
@@ -0,0 +1,26 @@
+/* termios tcflag symbolic contants 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-tcflow.h> directly; use <termios.h> instead."
+#endif
+
+/* tcsetattr uses these.  */
+#define        TCSANOW         0
+#define        TCSADRAIN       1
+#define        TCSAFLUSH       2
index e74618df226cb37e1b9302c18fb2ea07e38d19e6..a2ce092cec61dbc2eb46734e374123b280804be5 100644 (file)
@@ -71,11 +71,7 @@ typedef unsigned int tcflag_t;
 #define        TCOFLUSH        1
 #define        TCIOFLUSH       2
 
-/* tcsetattr uses these */
-#define        TCSANOW         0
-#define        TCSADRAIN       1
-#define        TCSAFLUSH       2
-
+#include <bits/termios-tcflow.h>
 
 #define _IOT_termios /* Hurd ioctl type field.  */ \
   _IOT (_IOTS (cflag_t), 4, _IOTS (cc_t), NCCS, _IOTS (speed_t), 2)
diff --git a/sysdeps/unix/sysv/linux/mips/bits/termios-tcflow.h b/sysdeps/unix/sysv/linux/mips/bits/termios-tcflow.h
new file mode 100644 (file)
index 0000000..68b2972
--- /dev/null
@@ -0,0 +1,26 @@
+/* termios local mode definitions.  Linux/mips 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-tcflow.h> directly; use <termios.h> instead."
+#endif
+
+/* tcsetattr uses these */
+#define        TCSANOW         0x540e  /* Same as TCSETS; change immediately.  */
+#define        TCSADRAIN       0x540f  /* Same as TCSETSW; change when pending output is written.  */
+#define        TCSAFLUSH       0x5410  /* Same as TCSETSF; flush pending input before changing.  */
index 8f6c918668e7cbb88d4789cf1970d79e901fab04..7f38f856f988fd42f4301293afe0cf8792602b2d 100644 (file)
@@ -71,10 +71,7 @@ typedef unsigned int tcflag_t;
 #define        TCOFLUSH        1       /* Discard data written but not yet sent.  */
 #define        TCIOFLUSH       2       /* Discard all pending data.  */
 
-/* tcsetattr uses these */
-#define        TCSANOW         0x540e  /* Same as TCSETS; change immediately.  */
-#define        TCSADRAIN       0x540f  /* Same as TCSETSW; change when pending output is written.  */
-#define        TCSAFLUSH       0x5410  /* Same as TCSETSF; flush pending input before changing.  */
+#include <bits/termios-tcflow.h>
 
 #define _IOT_termios /* Hurd ioctl type field.  */ \
   _IOT (_IOTS (cflag_t), 4, _IOTS (cc_t), NCCS, _IOTS (speed_t), 2)
index 65dad319d54feb4dc8e5ba9d2231f76bf43ee63b..18c27fe207c64d79e6fd017520f1f31ab0093571 100644 (file)
@@ -65,10 +65,7 @@ typedef unsigned int tcflag_t;
 #define        TCOFLUSH        1
 #define        TCIOFLUSH       2
 
-/* Values for the OPTIONAL_ACTIONS argument to `tcsetattr'.  */
-#define        TCSANOW         0
-#define        TCSADRAIN       1
-#define        TCSAFLUSH       2
+#include <bits/termios-tcflow.h>
 
 #ifdef __USE_MISC
 
index 12dc7061fecfa9db9e93d96ef40c209439aaa983..71d3c6e7e949a691892854e2593c9448cedf4f3e 100644 (file)
@@ -71,7 +71,4 @@ typedef unsigned int tcflag_t;
 #define        TCOFLUSH        1
 #define        TCIOFLUSH       2
 
-/* tcsetattr uses these */
-#define        TCSANOW         0
-#define        TCSADRAIN       1
-#define        TCSAFLUSH       2
+#include <bits/termios-tcflow.h>
This page took 0.080892 seconds and 5 git commands to generate.