1) Port NetBSD VMIN/VTIME stuff:
authorAndrey Chernov <ache@FreeBSD.org>
Fri, 28 Jan 1994 23:17:43 +0000 (23:17 +0000)
committerAndrey Chernov <ache@FreeBSD.org>
Fri, 28 Jan 1994 23:17:43 +0000 (23:17 +0000)
commit4bb4b305d10a49a9c9df42900c3c632ac31b2798
tree827676399a6c6ed90d2ec8c7241e1a82e310eb13
parent0b79ee478bcf0c976f57eeb0c7aff4cda7d8992e
1) Port NetBSD VMIN/VTIME stuff:
fix bug in case VMIN=0 && rawq len == 0,
fix bug with missing untimeouts.

2) Fixes from bde:
o Don't export private functions.
o Don't declare externs inside functions.  I moved the declaration
  of `nldisp' to the top of tty.c; it should be declared in some
  header.
o Moved ttywait() deadlock fix from sio.c to here so it doesn't
  harm efficiency and so it works with other drivers.
o Use "cuddle else style" ( "} else"  not "}\n\t..else" ).
o Don't clear TS_TBLOCK before it is used in ttyflush() (your version
  had this from a previous incomplete fix).
o Added long comment about probable botch of TS_ISOPEN and TS_WOPEN
  flags when CLOCAL drops while there is no carrier.
o Added comment about races in ttnread().  Only some callers use
  spltty().  ttselect() doesn't.
o Fixed use of random types (int, long) instead of tcflags_t and
  use of u_char instead of cc_t (you missed the changes in my
  previous diffs).
o "int alt = lflag&ALTWERASE" had the wrong type.  It's only used
  once, so don't use a flag variable for it.
o Fixed (? :-) use of MIN() and min() on integral types.  MIN()
  expands to min() and min() is an (inline) function that really
  only works for u_int types.  "gcc -Wconversion" told me about
  the sign botches.  Of course, a min of -1 would be fatal as
  the count arg for bcopy or bzero.
o Fixed missing loop exit after uiomove() failure in ttwrite()
  (bug introduced in my previous version :-().
o Fixed serious races in ttwrite().  The old clist buffer access
  functions apparently called spltty()/splx() (NetBSD's getc()
  and putc() do it) although this makes them slow.  Lots of
  races were introduced by the non-locking RB_* access macros.
o Cleaned up fix for ECHONL again.
o tp->t_gen is now int; use int for `gen' copy of it too.
sys/kern/tty.c