tty: implement read/write support
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user