/* Our "hardware" write method. Data is coming from the ldisc which may be in a non sleeping state. We simply throw this at the other end of the link as if we were an IRQ handler receiving stuff for the other side of the pty/tty pair.  */
static int pty_write(struct tty_struct *tty, const unsigned char *buf, int c)
/* Our "hardware" write method. Data is coming from the ldisc which may be in a non sleeping state. We simply throw this at the other end of the link as if we were an IRQ handler receiving stuff for the other side of the pty/tty pair.  */
static int pty_write(struct tty_struct *tty, const unsigned char *buf, int c)
{
	struct tty_struct *to = tty->link;
	if (tty->stopped)
		return 0;
	if (c > 0) {
		c = tty_insert_flip_string(to, buf, c);
		if (c) {
			tty_flip_buffer_push(to);
			tty_wakeup(tty);
		}
	}
	return c;
}