[tty] add TCGETA/TCSETAF/TCSETAW/TCSETA commands (#7739)

This commit is contained in:
Tennn11 2023-06-29 19:01:16 +08:00 committed by GitHub
parent 69ec7981c3
commit 148ae53cf8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 0 deletions

View File

@ -80,6 +80,7 @@ int n_tty_ioctl_extend(struct tty_struct *tty, int cmd, void *args)
switch(cmd)
{
case TCGETS:
case TCGETA:
{
struct termios *tio = (struct termios *)p;
if (tio == RT_NULL)
@ -102,6 +103,18 @@ int n_tty_ioctl_extend(struct tty_struct *tty, int cmd, void *args)
{
return set_termios(real_tty, p, TERMIOS_OLD);
}
case TCSETAF:
{
return set_termios(real_tty, p, TERMIOS_FLUSH | TERMIOS_WAIT | TERMIOS_TERMIO);
}
case TCSETAW:
{
return set_termios(real_tty, p, TERMIOS_WAIT | TERMIOS_TERMIO);
}
case TCSETA:
{
return set_termios(real_tty, p, TERMIOS_TERMIO);
}
default:
break;
}