libc/termios: Implement TCSADRAIN and TCSAFLUSH for tcsetattr
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com> Change-Id: If87a4931cd5a55e064f58c19a22c7ce13f538000
This commit is contained in:
parent
bf733f7213
commit
b8ed17b9da
|
@ -83,10 +83,15 @@
|
||||||
|
|
||||||
int tcsetattr(int fd, int options, FAR const struct termios *termiosp)
|
int tcsetattr(int fd, int options, FAR const struct termios *termiosp)
|
||||||
{
|
{
|
||||||
if (options == TCSANOW)
|
if (options != TCSANOW)
|
||||||
{
|
{
|
||||||
return ioctl(fd, TCSETS, (unsigned long)termiosp);
|
tcdrain(fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
return -ENOSYS;
|
if (options == TCSAFLUSH)
|
||||||
|
{
|
||||||
|
tcflush(fd, TCIFLUSH);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ioctl(fd, TCSETS, (unsigned long)termiosp);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue