int tty_write(struct inode *inode, struct file *file, char *data, int len) { register struct tty *tty = determine_tty(inode->i_rdev); register char *pi; #if 0 int blocking = (file->f_flags & O_NONBLOCK) ? 0 : 1; #endif pi = (char *)len; while ((int)(pi--)) { tty_charout(tty, get_user_char((void *)(data++)) /* , blocking */ ); } return len; }
int tty_write(struct inode *inode, struct file *file, char *data, int len) { register struct tty *tty = determine_tty(inode->i_rdev); register char *pi; #if 0 int blocking = (file->f_flags & O_NONBLOCK) ? 0 : 1; #endif __u16 tmp; pi = 0; while (((int)pi) < len) { tmp = peekb(current->t_regs.ds, (__u16) (data + ((int)pi))); tty_charout(tty, (unsigned char) tmp /* , blocking */ ); ++pi; } tty->ops->write(tty); return (int)pi; }
/* Write 1 byte to a terminal, with processing */ void tty_charout(register struct tty *tty, unsigned char ch) { switch (ch) { case '\t': if (tty->termios.c_lflag & ICANON) { register char *pi = (char *) TAB_SPACES; do { tty_charout_raw(tty, ' '); } while (--pi); return; } break; case '\n': if (tty->termios.c_oflag & ONLCR) tty_charout(tty, '\r'); } tty_charout_raw(tty, ch); }
void tty_echo(register struct tty *tty, unsigned char ch) { if (tty->termios.c_lflag & ECHO) tty_charout(tty, ch); }