+ register struct tty *tp = u.u_procp->p_session->s_ttyp;
+
+ if (tp != NULL && tp->t_session == u.u_procp->p_session)
+ prf(fmt, &x1, TOTTY, (caddr_t)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(vp, fmt, x1)
+ register caddr_t vp;
+ char *fmt;
+ unsigned x1;
+{
+#ifdef notyet
+ int flags = TOTTY | TOLOG;
+
+ logpri(LOG_INFO);
+
+ if (vp == NULL ||
+ VOP_IOCTL(vp, TIOCCHECKOUTQ, &val, FWRITE, NOCRED) != 0 ||
+ val == 0)
+ flags = TOLOG;
+ prf(fmt, &x1, flags, vp);
+ logwakeup();
+#else
+ printf("tprintf called\n");
+#endif
+}
+
+/*
+ * 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;
+
+ logpri(level);
+ prf(fmt, &x1, TOLOG, (caddr_t)0);
+ splx(s);
+ if (!log_open)
+ prf(fmt, &x1, TOCONS, (caddr_t)0);
+ logwakeup();
+}
+
+logpri(level)
+ int level;
+{
+
+ putchar('<', TOLOG, (caddr_t)0);
+ printn((u_long)level, 10, TOLOG, (caddr_t)0);
+ putchar('>', TOLOG, (caddr_t)0);
+}
+
+/*VARARGS1*/
+addlog(fmt, x1)
+ char *fmt;
+ unsigned x1;
+{
+ register s = splhigh();