extern ttyready_t tty_writeready(uint8_t minor);
extern void tty_sleeping(uint8_t minor);
extern void tty_putc(uint8_t minor, unsigned char c);
-extern void tty_setup(uint8_t minor);
+extern void tty_setup(uint8_t minor, uint8_t flags);
extern int tty_carrier(uint8_t minor);
extern void tty_data_consumed(uint8_t minor);
/* PTY pieces: 8 ptys both sides of */
t->users++;
return 0;
}
- tty_setup(minor);
+ tty_setup(minor, 0);
if ((t->termios.c_cflag & CLOCAL) || (flag & O_NDELAY))
goto out;
int tty_ioctl(uint8_t minor, uarg_t request, char *data)
{ /* Data in User Space */
struct tty *t;
+ uint8_t waito = 0;
t = &ttydata[minor];
switch (request) {
case TCGETS:
return uput(&t->termios, data, sizeof(struct termios));
- break;
case TCSETSF:
clrq(&ttyinq[minor]);
/* Fall through for now */
case TCSETSW:
- /* We don't have an output queue really so for now drop
- through */
+ waito = 1;
case TCSETS:
if (uget(data, &t->termios, sizeof(struct termios)) == -1)
return -1;
- tty_setup(minor);
+ tty_setup(minor, waito);
tty_selwake(minor, SELECT_IN|SELECT_OUT);
break;
case TIOCINQ: