initialized. Calling malloc(9) at that point is not a good idea. So
initialize consbuf later.
Fixes dmesg -s on sparc64 (and probably a few other architectures).
ok miod@, deraadt@
-/* $OpenBSD: init_main.c,v 1.231 2014/12/31 15:32:05 jsing Exp $ */
+/* $OpenBSD: init_main.c,v 1.232 2015/01/13 18:51:27 kettenis Exp $ */
/* $NetBSD: init_main.c,v 1.84.4.1 1996/06/02 09:08:06 mrg Exp $ */
/*
#include <sys/msg.h>
#endif
#include <sys/domain.h>
+#include <sys/msgbuf.h>
#include <sys/mbuf.h>
#include <sys/pipe.h>
#include <sys/task.h>
if_attachdomain();
splx(s);
+ initconsbuf();
+
#ifdef GPROF
/* Initialize kernel profiling. */
kmstartup();
-/* $OpenBSD: subr_log.c,v 1.26 2015/01/13 10:07:58 mpf Exp $ */
+/* $OpenBSD: subr_log.c,v 1.27 2015/01/13 18:51:27 kettenis Exp $ */
/* $NetBSD: subr_log.c,v 1.11 1996/03/30 22:24:44 christos Exp $ */
/*
/* mark it as ready for use. */
msgbufmapped = 1;
+}
+
+void
+initconsbuf(void)
+{
+ long new_bufs;
/* Set up a buffer to collect /dev/console output */
consbufp = malloc(CONSBUFSIZE, M_TEMP, M_NOWAIT|M_ZERO);
-/* $OpenBSD: msgbuf.h,v 1.9 2015/01/13 10:07:58 mpf Exp $ */
+/* $OpenBSD: msgbuf.h,v 1.10 2015/01/13 18:51:27 kettenis Exp $ */
/* $NetBSD: msgbuf.h,v 1.8 1995/03/26 20:24:27 jtc Exp $ */
/*
extern struct msgbuf *consbufp;
void initmsgbuf(caddr_t buf, size_t bufsize);
+void initconsbuf(void);
void msgbuf_putchar(struct msgbuf *, const char c);
#endif