/* The tty buffers allow 64K but we sneak a peak and clip at 8K this allows a lot of overspill room for echo and other fun messes to be handled properly  */
static int pty_space(struct tty_struct *to)
/* The tty buffers allow 64K but we sneak a peak and clip at 8K this allows a lot of overspill room for echo and other fun messes to be handled properly  */
static int pty_space(struct tty_struct *to)
{
	int n = 8192 - to->buf.memory_used;
	if (n < 0)
		return 0;
	return n;
}