+void
+tty_set_baud (TTY * t, int rate)
+{
+ struct termios tios = { 0 };
+
+ speed_t s = baud_to_speed_t (rate);
+
+ if (s == (speed_t) - 1)
+ return;
+
+ if (tcgetattr (t->rfd, &tios))
+ return;
+
+ cfsetispeed (&tios, s);
+ cfsetospeed (&tios, s);
+
+ tcsetattr (t->rfd, TCSANOW, &tios);
+}
+
+void
+tty_send_break (TTY * t)
+{
+ tcsendbreak (t->wfd, 0);
+}
+
+void
+tty_set_flow (TTY * t, int flow)
+{
+ struct termios tios = { 0 };
+
+ if (tcgetattr (t->rfd, &tios))
+ return;
+
+ if (flow)
+ tios.c_cflag |= CRTSCTS;
+ else
+ tios.c_cflag &= ~CRTSCTS;
+
+ tcsetattr (t->rfd, TCSANOW, &tios);
+
+}
+
+