| 559 | } |
| 560 | |
| 561 | static int |
| 562 | ttydev_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, |
| 563 | struct thread *td) |
| 564 | { |
| 565 | struct tty *tp = dev->si_drv1; |
| 566 | int error; |
| 567 | |
| 568 | error = ttydev_enter(tp); |
| 569 | if (error) |
| 570 | return (error); |
| 571 | |
| 572 | switch (cmd) { |
| 573 | case TIOCCBRK: |
| 574 | case TIOCCONS: |
| 575 | case TIOCDRAIN: |
| 576 | case TIOCEXCL: |
| 577 | case TIOCFLUSH: |
| 578 | case TIOCNXCL: |
| 579 | case TIOCSBRK: |
| 580 | case TIOCSCTTY: |
| 581 | case TIOCSETA: |
| 582 | case TIOCSETAF: |
| 583 | case TIOCSETAW: |
| 584 | case TIOCSPGRP: |
| 585 | case TIOCSTART: |
| 586 | case TIOCSTAT: |
| 587 | case TIOCSTI: |
| 588 | case TIOCSTOP: |
| 589 | case TIOCSWINSZ: |
| 590 | #if 0 |
| 591 | case TIOCSDRAINWAIT: |
| 592 | case TIOCSETD: |
| 593 | #endif |
| 594 | #ifdef COMPAT_43TTY |
| 595 | case TIOCLBIC: |
| 596 | case TIOCLBIS: |
| 597 | case TIOCLSET: |
| 598 | case TIOCSETC: |
| 599 | case OTIOCSETD: |
| 600 | case TIOCSETN: |
| 601 | case TIOCSETP: |
| 602 | case TIOCSLTC: |
| 603 | #endif /* COMPAT_43TTY */ |
| 604 | /* |
| 605 | * If the ioctl() causes the TTY to be modified, let it |
| 606 | * wait in the background. |
| 607 | */ |
| 608 | error = tty_wait_background(tp, curthread, SIGTTOU); |
| 609 | if (error) |
| 610 | goto done; |
| 611 | } |
| 612 | |
| 613 | if (cmd == TIOCSETA || cmd == TIOCSETAW || cmd == TIOCSETAF) { |
| 614 | struct termios *old = &tp->t_termios; |
| 615 | struct termios *new = (struct termios *)data; |
| 616 | struct termios *lock = TTY_CALLOUT(tp, dev) ? |
| 617 | &tp->t_termios_lock_out : &tp->t_termios_lock_in; |
| 618 | int cc; |
nothing calls this directly
no test coverage detected