2 * Copyright (C) 2001 - 2007 Jeff Dike (jdike@{linux.intel,addtoit}.com)
3 * Licensed under the GPL
10 #include "kern_constants.h"
12 #include "um_malloc.h"
21 static void *tty_chan_init(char *str, int device, const struct chan_opts *opts)
23 struct tty_chan *data;
26 printk(UM_KERN_ERR "tty_init : channel type 'tty' must specify "
32 data = uml_kmalloc(sizeof(*data), UM_GFP_KERNEL);
35 *data = ((struct tty_chan) { .dev = str,
41 static int tty_open(int input, int output, int primary, void *d,
44 struct tty_chan *data = d;
45 int fd, err, mode = 0;
54 fd = open(data->dev, mode);
59 CATCH_EINTR(err = tcgetattr(fd, &data->tt));
72 const struct chan_ops tty_ops = {
74 .init = tty_chan_init,
76 .close = generic_close,
78 .write = generic_write,
79 .console_write = generic_console_write,
80 .window_size = generic_window_size,