| 2172 | */ |
| 2173 | |
| 2174 | static int |
| 2175 | ttyconsdev_open(struct cdev *dev, int oflags, int devtype, struct thread *td) |
| 2176 | { |
| 2177 | struct tty *tp; |
| 2178 | |
| 2179 | /* System has no console device. */ |
| 2180 | if (dev_console_filename == NULL) |
| 2181 | return (ENXIO); |
| 2182 | |
| 2183 | /* Look up corresponding TTY by device name. */ |
| 2184 | sx_slock(&tty_list_sx); |
| 2185 | TAILQ_FOREACH(tp, &tty_list, t_list) { |
| 2186 | if (strcmp(dev_console_filename, tty_devname(tp)) == 0) { |
| 2187 | dev_console->si_drv1 = tp; |
| 2188 | break; |
| 2189 | } |
| 2190 | } |
| 2191 | sx_sunlock(&tty_list_sx); |
| 2192 | |
| 2193 | /* System console has no TTY associated. */ |
| 2194 | if (dev_console->si_drv1 == NULL) |
| 2195 | return (ENXIO); |
| 2196 | |
| 2197 | return (ttydev_open(dev, oflags, devtype, td)); |
| 2198 | } |
| 2199 | |
| 2200 | static int |
| 2201 | ttyconsdev_write(struct cdev *dev, struct uio *uio, int ioflag) |
nothing calls this directly
no test coverage detected