tty: reading input from a tty is now handled by the line discipline

This commit is contained in:
2023-06-14 17:38:03 +01:00
parent 16d0a398b3
commit 2656696757
4 changed files with 206 additions and 10 deletions

View File

@@ -75,8 +75,14 @@ static void putchar(struct device *tty, int c)
kern_status_t tty_read(struct device *tty, void *buf, size_t max, size_t *nr_read, socks_flags_t flags)
{
printk("tty_read");
return KERN_OK;
kern_status_t status = KERN_UNSUPPORTED;
struct tty_device *ttydev = TTY_DEVICE(tty);
if (ttydev->tty_ldisc || ttydev->tty_ldisc->read) {
status = ttydev->tty_ldisc->read(tty, buf, max, nr_read, flags);
}
return status;
}
kern_status_t tty_write(struct device *tty, const void *buf, size_t len, size_t *nr_written, socks_flags_t flags)