Lines Matching refs:con

182 	struct console* con = (struct console*)arg;
186 ssize_t length = read(con->tty_master_fd, buffer, sizeof(buffer));
190 write(con->console_fd, buffer, length);
198 stop_keyboards(struct console* con)
202 for (struct keyboard* keyboard = con->keyboards; keyboard != NULL;
209 for (struct keyboard* keyboard = con->keyboards; keyboard != NULL;) {
217 con->keyboards = NULL;
295 start_console(struct console* con)
297 memset(con, 0, sizeof(struct console));
298 con->console_fd = -1;
299 con->tty_master_fd = -1;
300 con->tty_slave_fd = -1;
301 con->console_writer = -1;
303 con->console_fd = open("/dev/console", O_WRONLY);
304 if (con->console_fd < 0)
318 con->tty_master_fd = open(name, O_RDWR);
319 if (con->tty_master_fd >= 0) {
322 con->tty_slave_fd = open(name, O_RDWR);
323 if (con->tty_slave_fd < 0) {
326 close(con->tty_master_fd);
332 if (tcgetattr(con->tty_slave_fd, &termios) == 0) {
337 tcsetattr(con->tty_slave_fd, TCSANOW, &termios);
340 if (ioctl(con->console_fd, TIOCGWINSZ, &size,
343 ioctl(con->tty_slave_fd, TIOCSWINSZ, &size,
354 if (con->tty_master_fd < 0 || con->tty_slave_fd < 0)
357 con->keyboards
358 = open_keyboards(con->tty_master_fd, "/dev/input/keyboard", NULL);
359 if (con->keyboards == NULL)
362 con->console_writer = spawn_thread(&console_writer, "console writer",
363 B_URGENT_DISPLAY_PRIORITY, con);
364 if (con->console_writer < 0)
367 resume_thread(con->console_writer);
375 stop_console(struct console* con)
378 close(con->tty_master_fd);
379 close(con->tty_slave_fd);
382 close(con->console_fd);
383 wait_for_thread(con->console_writer, NULL);
385 stop_keyboards(con);
390 start_process(int argc, const char** argv, struct console* con)
396 dup2(con->tty_slave_fd, 0);
397 dup2(con->tty_slave_fd, 1);
398 dup2(con->tty_slave_fd, 2);
403 tcsetpgrp(con->tty_slave_fd, pid);