-int
-__tty_exec_cmd(struct device* dev, u32_t req, va_list args)
-{
- switch (req) {
- case TIOCGPGRP:
- return fg_pgid;
- case TIOCSPGRP:
- fg_pgid = va_arg(args, pid_t);
- break;
- case TIOCCLSBUF:
- fifo_clear(&lx_console.output);
- fifo_clear(&lx_console.input);
- lx_console.wnd_start = 0;
- lx_console.lines = 0;
- lx_console.output.flags |= FIFO_DIRTY;
- break;
- case TIOCFLUSH:
- lx_console.output.flags |= FIFO_DIRTY;
- console_flush();
- break;
- default:
- return EINVAL;
- }
- return 0;
-}
-
-void
-lxconsole_init()
-{
- memset(&lx_console, 0, sizeof(lx_console));
- fifo_init(&lx_console.output, valloc(8192), 8192, 0);
- fifo_init(&lx_console.input, valloc(4096), 4096, 0);
-
- lx_console.flush_timer = NULL;
-}
-