summaryrefslogtreecommitdiffstats
path: root/sys/kern/tty.c
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2009-06-28 12:02:15 +0000
committered <ed@FreeBSD.org>2009-06-28 12:02:15 +0000
commitfda6c6ecf488a5884ac01ca2fae490c4f804319d (patch)
tree8692648eebd3db41f9068a599363a0d97c102db0 /sys/kern/tty.c
parentee7f38d0ae5c325fee7a18176984f734a92b7c08 (diff)
downloadFreeBSD-src-fda6c6ecf488a5884ac01ca2fae490c4f804319d.zip
FreeBSD-src-fda6c6ecf488a5884ac01ca2fae490c4f804319d.tar.gz
Add FIONWRITE support to TTYs.
TTYs already supported TIOCOUTQ, but FIONWRITE seems to be a more generic name for this. Approved by: re (kib)
Diffstat (limited to 'sys/kern/tty.c')
-rw-r--r--sys/kern/tty.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/kern/tty.c b/sys/kern/tty.c
index f98a70f..d8a76d9 100644
--- a/sys/kern/tty.c
+++ b/sys/kern/tty.c
@@ -1341,6 +1341,10 @@ tty_generic_ioctl(struct tty *tp, u_long cmd, void *data, struct thread *td)
case FIONREAD:
*(int *)data = ttyinq_bytescanonicalized(&tp->t_inq);
return (0);
+ case FIONWRITE:
+ case TIOCOUTQ:
+ *(int *)data = ttyoutq_bytesused(&tp->t_outq);
+ return (0);
case FIOSETOWN:
if (tp->t_session != NULL && !tty_is_ctty(tp, td->td_proc))
/* Not allowed to set ownership. */
@@ -1603,9 +1607,6 @@ tty_generic_ioctl(struct tty *tp, u_long cmd, void *data, struct thread *td)
case TIOCNXCL:
tp->t_flags &= ~TF_EXCLUDE;
return (0);
- case TIOCOUTQ:
- *(unsigned int *)data = ttyoutq_bytesused(&tp->t_outq);
- return (0);
case TIOCSTOP:
tp->t_flags |= TF_STOPPED;
ttydevsw_pktnotify(tp, TIOCPKT_STOP);
OpenPOWER on IntegriCloud