Subject: Re: tty.c buffer overflow?
To: David McConnell <davem@eastcoast.co.za>
From: Richard Earnshaw <rearnsha@arm.com>
List: port-arm32
Date: 03/23/2000 17:09:36
> Hi There
> 
> In "tty.c" ttyinput() has a check for too many characters in its input
> queues, as follows:
> 
> /*
>   * Check for input buffer overflow
>   */
>  if (tp->t_rawq.c_cc + tp->t_canq.c_cc >= TTYHOG) {
>   if (ISSET(iflag, IMAXBEL)) {
>    if (tp->t_outq.c_cc < tp->t_hiwat)
>     (void)ttyoutput(CTRL('g'), tp);
>   } else
>    printf("\n6\n");
>    ttyflush(tp, FREAD | FWRITE);
>   goto endcase;
> 
> 
> 
> My question is why does the "ttyflush" have FWRITE specified as well? I mean
> this is an input queue problem, why flush the output queue?
> 
> It seems to me it causes output data to be unnecessarily lost?
> 
> Am I missing something here, or was it just an oversight?
> 

Hmm, might this explain why I get so many silo overflows when using pppd 
over a modem, or why, occasionally (well, not that occasionally) the modem 
just hangs up?

R.