Subject: tty/kernel help
To: None <current-users@NetBSD.ORG>
From: Robert Dobbs <banshee@gabriella.resort.com>
List: current-users
Date: 02/09/1995 02:11:27
(sorry about the last one, paste sent ^d)

Could someone in the know, explain the need for the following code 
snippet, taken from the output routine in com.c

        /*
         * If the tty queue has dropped below the low water mark
         * and we're asleep, then wake us up.  Make us awake
         * when a selectable event comes along.
         */
        if (tp->t_outq.c_cc <= tp->t_lowat) {
                if (tp->t_state & TS_ASLEEP) {
                        tp->t_state &= ~TS_ASLEEP;
                        /* kern_synch.c */
                        wakeup((caddr_t)&tp->t_outq);
                }
                /* sys_generic.c */
                selwakeup(&tp->t_wsel);
                log(LOG_ERR, "ESP espstart() wakeup\n");
        }

I'm assuming that when a tty is idle, the system puts it into an
asleep state, and I'm supposing that it needs to be woken up before
we start getting data from it.  Is this because we use a kernel routine
to transfer data from the tty outq?  Theres no need to keep this on the
mail alias, just reply to me directly.  Thanks.

-john