summaryrefslogtreecommitdiff
path: root/headers/android/legacy_termios_inlines.h
diff options
context:
space:
mode:
Diffstat (limited to 'headers/android/legacy_termios_inlines.h')
-rw-r--r--headers/android/legacy_termios_inlines.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/headers/android/legacy_termios_inlines.h b/headers/android/legacy_termios_inlines.h
index 4424bdb0b..02e942920 100644
--- a/headers/android/legacy_termios_inlines.h
+++ b/headers/android/legacy_termios_inlines.h
@@ -91,6 +91,18 @@ static __inline void cfmakeraw(struct termios *s) {
s->c_cflag |= CS8;
}
+static __inline int cfsetspeed(struct termios* s, speed_t speed) {
+ // TODO: check 'speed' is valid.
+ s->c_cflag = (s->c_cflag & ~CBAUD) | (speed & CBAUD);
+ return 0;
+}
+
+static __inline int tcdrain(int fd) {
+ // A non-zero argument to TCSBRK means "don't send a break".
+ // The drain is a side-effect of the ioctl!
+ return ioctl(fd, TCSBRK, __BIONIC_CAST(static_cast, unsigned long, 1));
+}
+
__END_DECLS
#endif