tty: implement read/write support

This commit is contained in:
2023-06-11 09:23:57 +01:00
parent 557e1dda30
commit abe4af093e
9 changed files with 124 additions and 14 deletions

View File

@@ -2,6 +2,11 @@
#include <socks/device.h>
#include <socks/libc/stdio.h>
static struct char_device_ops tty_ops = {
.read = tty_read,
.write = tty_write,
};
struct device *tty_device_create(void)
{
struct char_device *cdev = char_device_create();
@@ -15,7 +20,9 @@ struct device *tty_device_create(void)
return NULL;
}
cdev->c_ops = &tty_ops;
cdev->c_tty = tty_dev;
return char_device_base(cdev);
}