aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/tcsetattr.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv/linux/tcsetattr.c')
-rw-r--r--sysdeps/unix/sysv/linux/tcsetattr.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/sysdeps/unix/sysv/linux/tcsetattr.c b/sysdeps/unix/sysv/linux/tcsetattr.c
index 4f07a03..ad8f2df 100644
--- a/sysdeps/unix/sysv/linux/tcsetattr.c
+++ b/sysdeps/unix/sysv/linux/tcsetattr.c
@@ -19,6 +19,12 @@
#define static_assert_equal(x,y) _Static_assert ((x) == (y), #x " != " #y)
+static_assert_equal (sizeof (struct termios2), KERNEL_TERMIOS2_SIZE);
+static_assert_equal (offsetof (struct termios2, c_cc),
+ KERNEL_TERMIOS2_CC_OFFSET);
+static_assert_equal (offsetof (struct termios2, c_line),
+ KERNEL_TERMIOS2_LINE_OFFSET);
+
/* Set the state of FD to *TERMIOS_P. */
int
__tcsetattr (int fd, int optional_actions, const struct termios *termios_p)
@@ -53,10 +59,10 @@ __tcsetattr (int fd, int optional_actions, const struct termios *termios_p)
*/
static_assert_equal(TCSADRAIN, TCSANOW + 1);
static_assert_equal(TCSAFLUSH, TCSANOW + 2);
- static_assert_equal(TCSETSW2, TCSETS2 + 1);
- static_assert_equal(TCSETSF2, TCSETS2 + 2);
- static_assert_equal(TCSETSW, TCSETS + 1);
- static_assert_equal(TCSETSF, TCSETS + 2);
+ static_assert_equal(KERNEL_TCSETSW2, KERNEL_TCSETS2 + 1);
+ static_assert_equal(KERNEL_TCSETSF2, KERNEL_TCSETS2 + 2);
+ static_assert_equal(KERNEL_TCSETSW, KERNEL_TCSETS + 1);
+ static_assert_equal(KERNEL_TCSETSF, KERNEL_TCSETS + 2);
cmd = (long)optional_actions - TCSANOW;
if (cmd > 2)
@@ -66,11 +72,11 @@ __tcsetattr (int fd, int optional_actions, const struct termios *termios_p)
k_termios.c_ospeed != k_termios.c_ispeed ||
cbaud (k_termios.c_cflag) == __BOTHER)
{
- cmd += TCSETS2;
+ cmd += KERNEL_TCSETS2;
}
else
{
- cmd += TCSETS;
+ cmd += KERNEL_TCSETS;
k_termios.c_cflag &= ~CIBAUD;
}