| 501 | } |
| 502 | |
| 503 | static int |
| 504 | ttydev_read(struct cdev *dev, struct uio *uio, int ioflag) |
| 505 | { |
| 506 | struct tty *tp = dev->si_drv1; |
| 507 | int error; |
| 508 | |
| 509 | error = ttydev_enter(tp); |
| 510 | if (error) |
| 511 | goto done; |
| 512 | error = ttydisc_read(tp, uio, ioflag); |
| 513 | tty_unlock(tp); |
| 514 | |
| 515 | /* |
| 516 | * The read() call should not throw an error when the device is |
| 517 | * being destroyed. Silently convert it to an EOF. |
| 518 | */ |
| 519 | done: if (error == ENXIO) |
| 520 | error = 0; |
| 521 | return (error); |
| 522 | } |
| 523 | |
| 524 | static int |
| 525 | ttydev_write(struct cdev *dev, struct uio *uio, int ioflag) |
nothing calls this directly
no test coverage detected