+#ifdef notdef
+ register struct proc *p;
+#endif
+ register struct tty *tp;
+
+ if ((tp = u.u_ttyp) == NULL)
+ return;
+#ifdef notdef
+ if (tp->t_pgrp && (p = pfind(tp->t_pgrp)))
+ if (p->p_uid != u.u_uid) /* doesn't account for setuid */
+ return;
+#endif
+ if (ttycheckoutq(tp, 1))
+ prf(fmt, &x1, TOTTY, tp);
+}
+
+/*
+ * tprintf prints on the specified terminal (console if none)
+ * and logs the message. It is designed for error messages from
+ * single-open devices, and may be called from interrupt level
+ * (does not sleep).
+ */
+/*VARARGS2*/
+tprintf(tp, fmt, x1)
+ register struct tty *tp;
+ char *fmt;
+ unsigned x1;
+{
+ int flags = TOTTY | TOLOG;
+
+ logpri(LOG_INFO);
+ if (tp == (struct tty *)NULL) {
+ tp = constty;
+ if (tp == (struct tty *)NULL)
+ tp = &cons;
+ }
+ if (ttycheckoutq(tp, 0) == 0)
+ flags = TOLOG;
+ prf(fmt, &x1, flags, tp);
+ logwakeup();
+}
+
+/*
+ * Log writes to the log buffer,
+ * and guarantees not to sleep (so can be called by interrupt routines).
+ * If there is no process reading the log yet, it writes to the console also.
+ */
+/*VARARGS2*/
+log(level, fmt, x1)
+ char *fmt;
+ unsigned x1;
+{
+ register s = splhigh();
+ extern int log_open;