-/* $OpenBSD: subr_log.c,v 1.46 2016/06/08 11:11:47 bluhm Exp $ */
+/* $OpenBSD: subr_log.c,v 1.47 2016/06/23 13:15:21 bluhm Exp $ */
/* $NetBSD: subr_log.c,v 1.11 1996/03/30 22:24:44 christos Exp $ */
/*
if (mbp->msg_bufr == mbp->msg_bufx) {
if (++mbp->msg_bufr >= mbp->msg_bufs)
mbp->msg_bufr = 0;
+ mbp->msg_bufd++;
}
splx(s);
}
}
logsoftc.sc_state &= ~LOG_RDWAIT;
+ if (mbp->msg_bufd > 0) {
+ char buf[64];
+
+ l = snprintf(buf, sizeof(buf),
+ "<%d>klog: dropped %ld byte%s, message buffer full\n",
+ LOG_KERN|LOG_WARNING, mbp->msg_bufd,
+ mbp->msg_bufd == 1 ? "" : "s");
+ error = uiomove(buf, ulmin(l, sizeof(buf) - 1), uio);
+ if (error)
+ goto out;
+ mbp->msg_bufd = 0;
+ }
+
while (uio->uio_resid > 0) {
if (mbp->msg_bufx >= mbp->msg_bufr)
l = mbp->msg_bufx - mbp->msg_bufr;
-/* $OpenBSD: msgbuf.h,v 1.10 2015/01/13 18:51:27 kettenis Exp $ */
+/* $OpenBSD: msgbuf.h,v 1.11 2016/06/23 13:15:21 bluhm Exp $ */
/* $NetBSD: msgbuf.h,v 1.8 1995/03/26 20:24:27 jtc Exp $ */
/*
long msg_bufr; /* read pointer */
long msg_bufs; /* real msg_bufc size (bytes) */
long msg_bufl; /* # chars, <= msg_bufs */
+ long msg_bufd; /* number of dropped bytes */
char msg_bufc[1]; /* buffer */
};
#ifdef _KERNEL