Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 May 1996 02:01:34 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        freebsd-hackers@FreeBSD.org, tom@uces.bangor.ac.uk
Subject:   Re: write and pty's
Message-ID:  <199605141601.CAA10288@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>...
>After some hours with xxgdb and libraries compiled with debugging symbols,
>I tracked the problem to a write call. This write call returns 0 even 
>though it appears that a charater has been written. The fact that this
>call returns 0 means that the write pointer in the cmdtool code is not
>updated and so it is written again etc. (you get the picture)
>...
>I am running FreeBSD-2.2-SNAP 960128 with the xview-3.2 patched for X11R6.
>The problem also exists on 2.1-RELEASE.

This should be fixed in current SNAPs and stables (versions after April 11).
It happened for most writes of more than about 100 bytes if PF_REMOTE was set.

Bruce

Index: tty_pty.c
===================================================================
RCS file: /a/ncvs/src/sys/kern/tty_pty.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -c -1 -r1.37 -r1.38
*** tty_pty.c	1996/03/11 02:24:39	1.37
--- tty_pty.c	1996/04/11 18:43:37	1.38
***************
*** 33,35 ****
   *	@(#)tty_pty.c	8.4 (Berkeley) 2/20/95
!  * $Id: tty_pty.c,v 1.37 1996/03/11 02:24:39 hsu Exp $
   */
--- 33,35 ----
   *	@(#)tty_pty.c	8.4 (Berkeley) 2/20/95
!  * $Id: tty_pty.c,v 1.38 1996/04/11 18:43:37 bde Exp $
   */
***************
*** 536,539 ****
  			}
! 			if (cc)
! 				cc -= b_to_q((char *)cp, cc, &tp->t_canq);
  		}
--- 536,550 ----
  			}
! 			if (cc > 0) {
! 				cc = b_to_q((char *)cp, cc, &tp->t_canq);
! 				/*
! 				 * XXX we don't guarantee that the canq size
! 				 * is >= TTYHOG, so the above b_to_q() may
! 				 * leave some bytes uncopied.  However, space
! 				 * is guaranteed for the null terminator if
! 				 * we don't fail here since (TTYHOG - 1) is
! 				 * not a multiple of CBSIZE.
! 				 */
! 				if (cc > 0)
! 					break;
! 			}
  		}
***************
*** 576,578 ****
  	 * Come here to wait for slave to open, for space
! 	 * in outq, or space in rawq.
  	 */
--- 587,589 ----
  	 * Come here to wait for slave to open, for space
! 	 * in outq, or space in rawq, or an empty canq.
  	 */



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