Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 28 Jun 2009 12:02:16 +0000 (UTC)
From:      Ed Schouten <ed@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r195136 - head/sys/kern
Message-ID:  <200906281202.n5SC2GNk011210@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ed
Date: Sun Jun 28 12:02:15 2009
New Revision: 195136
URL: http://svn.freebsd.org/changeset/base/195136

Log:
  Add FIONWRITE support to TTYs.
  
  TTYs already supported TIOCOUTQ, but FIONWRITE seems to be a more
  generic name for this.
  
  Approved by:	re (kib)

Modified:
  head/sys/kern/tty.c

Modified: head/sys/kern/tty.c
==============================================================================
--- head/sys/kern/tty.c	Sun Jun 28 11:32:52 2009	(r195135)
+++ head/sys/kern/tty.c	Sun Jun 28 12:02:15 2009	(r195136)
@@ -1341,6 +1341,10 @@ tty_generic_ioctl(struct tty *tp, u_long
 	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
 	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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906281202.n5SC2GNk011210>