summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/termios.cc
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/termios.cc')
-rw-r--r--winsup/cygwin/termios.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/winsup/cygwin/termios.cc b/winsup/cygwin/termios.cc
index 0fb0de2ad..80c686952 100644
--- a/winsup/cygwin/termios.cc
+++ b/winsup/cygwin/termios.cc
@@ -328,6 +328,20 @@ cfsetispeed (struct termios *in_tp, speed_t speed)
return res;
}
+/* cfsetspeed: 4.4BSD */
+extern "C" int
+cfsetspeed (struct termios *in_tp, speed_t speed)
+{
+ struct termios *tp = __tonew_termios (in_tp);
+ int res;
+ /* errors come only from unsupported baud rates, so setspeed() would return
+ identical results in both calls */
+ if ((res = setspeed (tp->c_ospeed, speed)) == 0)
+ setspeed (tp->c_ispeed, speed);
+ __toapp_termios (in_tp, tp);
+ return res;
+}
+
extern "C" void
cfmakeraw(struct termios *tp)
{