History log of /openbsd-current/sys/sys/msgbuf.h
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.13 25-Oct-2020 visa

Serialize msgbuf access with a mutex.

This introduces a system-wide mutex that serializes msgbuf operations.
The mutex controls access to all modifiable fields of struct msgbuf.
It also covers logsoftc.sc_state.

To avoid adding extra lock order constraints that would affect use of
printf(9), the code does not take new locks when the log mutex is held.

The code assumes that there is at most one thread using logread(). This
keeps the logic simple. If there was more than one reader, logread()
might return the same data to different readers. Also, log wakeup might
not be reliable with multiple threads.

Tested in snaps for two weeks.

OK mpi@


Revision tags: OPENBSD_6_8_BASE
# 1.12 18-Aug-2020 visa

Remove an unnecessary field from struct msgbuf.

OK mvs@


Revision tags: OPENBSD_6_0_BASE OPENBSD_6_1_BASE OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE OPENBSD_6_6_BASE OPENBSD_6_7_BASE
# 1.11 23-Jun-2016 bluhm

It is annoying that the dmesg buffer can overflow and loose messages
undetected during debugging. To make clear what happens, count the
dropped bytes and write message buffer full to syslogd. This also
helps to have a reliable log system.
OK deraadt@ millert@ tedu@


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE OPENBSD_5_9_BASE
# 1.10 13-Jan-2015 kettenis

Many architectures call initmsgbuf() really really early, before uvm is
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@


# 1.9 13-Jan-2015 mpf

Add dmesg -s support, to view the output of rc(8) system startup messages.
Help and feedback by Theo and Miod.
OK deraadt@, manpage-ok jmc@


Revision tags: OPENBSD_3_8_BASE OPENBSD_3_9_BASE OPENBSD_4_0_BASE OPENBSD_4_1_BASE OPENBSD_4_2_BASE OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.8 14-Apr-2005 krw

Try to start log message buffer on a new line. Helps install scripts avoid
detecting phantom devices when scanning dmesg output.

Suggested by miod@, ok deraadt@.


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE OPENBSD_3_6_BASE OPENBSD_3_7_BASE SMP_SYNC_A SMP_SYNC_B
# 1.7 02-Jun-2003 millert

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.


Revision tags: OPENBSD_3_2_BASE OPENBSD_3_3_BASE UBC_SYNC_A UBC_SYNC_B
# 1.6 03-Jul-2002 miod

Change all variables definitions (int foo) in sys/sys/*.h to variable
declarations (extern int foo), and compensate in the appropriate locations.


Revision tags: OPENBSD_3_1_BASE
# 1.5 14-Mar-2002 millert

First round of __P removal in sys


Revision tags: OPENBSD_2_7_BASE OPENBSD_2_8_BASE OPENBSD_2_9_BASE OPENBSD_3_0_BASE UBC_BASE
# 1.4 13-Mar-2000 millert

branches: 1.4.10;
Get rid of leading NULs in /kern/msgbuf. If the msgbuf modified in between
reads at just the right time is is possible to get duplicate output but
in practice this is extremely rare. Joint effort with Theo.


# 1.3 22-Feb-2000 deraadt

enlarge msgbuf, somewhat line netbsd did


Revision tags: OPENBSD_2_0_BASE OPENBSD_2_1_BASE OPENBSD_2_2_BASE OPENBSD_2_3_BASE OPENBSD_2_4_BASE OPENBSD_2_5_BASE OPENBSD_2_6_BASE SMP_BASE kame_19991208
# 1.2 03-Mar-1996 niklas

branches: 1.2.16;
From NetBSD: 960217 merge


# 1.1 18-Oct-1995 deraadt

branches: 1.1.1;
Initial revision


# 1.12 18-Aug-2020 visa

Remove an unnecessary field from struct msgbuf.

OK mvs@


Revision tags: OPENBSD_6_0_BASE OPENBSD_6_1_BASE OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE OPENBSD_6_6_BASE OPENBSD_6_7_BASE
# 1.11 23-Jun-2016 bluhm

It is annoying that the dmesg buffer can overflow and loose messages
undetected during debugging. To make clear what happens, count the
dropped bytes and write message buffer full to syslogd. This also
helps to have a reliable log system.
OK deraadt@ millert@ tedu@


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE OPENBSD_5_9_BASE
# 1.10 13-Jan-2015 kettenis

Many architectures call initmsgbuf() really really early, before uvm is
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@


# 1.9 13-Jan-2015 mpf

Add dmesg -s support, to view the output of rc(8) system startup messages.
Help and feedback by Theo and Miod.
OK deraadt@, manpage-ok jmc@


Revision tags: OPENBSD_3_8_BASE OPENBSD_3_9_BASE OPENBSD_4_0_BASE OPENBSD_4_1_BASE OPENBSD_4_2_BASE OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.8 14-Apr-2005 krw

Try to start log message buffer on a new line. Helps install scripts avoid
detecting phantom devices when scanning dmesg output.

Suggested by miod@, ok deraadt@.


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE OPENBSD_3_6_BASE OPENBSD_3_7_BASE SMP_SYNC_A SMP_SYNC_B
# 1.7 02-Jun-2003 millert

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.


Revision tags: OPENBSD_3_2_BASE OPENBSD_3_3_BASE UBC_SYNC_A UBC_SYNC_B
# 1.6 03-Jul-2002 miod

Change all variables definitions (int foo) in sys/sys/*.h to variable
declarations (extern int foo), and compensate in the appropriate locations.


Revision tags: OPENBSD_3_1_BASE
# 1.5 14-Mar-2002 millert

First round of __P removal in sys


Revision tags: OPENBSD_2_7_BASE OPENBSD_2_8_BASE OPENBSD_2_9_BASE OPENBSD_3_0_BASE UBC_BASE
# 1.4 13-Mar-2000 millert

branches: 1.4.10;
Get rid of leading NULs in /kern/msgbuf. If the msgbuf modified in between
reads at just the right time is is possible to get duplicate output but
in practice this is extremely rare. Joint effort with Theo.


# 1.3 22-Feb-2000 deraadt

enlarge msgbuf, somewhat line netbsd did


Revision tags: OPENBSD_2_0_BASE OPENBSD_2_1_BASE OPENBSD_2_2_BASE OPENBSD_2_3_BASE OPENBSD_2_4_BASE OPENBSD_2_5_BASE OPENBSD_2_6_BASE SMP_BASE kame_19991208
# 1.2 03-Mar-1996 niklas

branches: 1.2.16;
From NetBSD: 960217 merge


# 1.1 18-Oct-1995 deraadt

branches: 1.1.1;
Initial revision


Revision tags: OPENBSD_6_0_BASE OPENBSD_6_1_BASE OPENBSD_6_2_BASE
# 1.11 23-Jun-2016 bluhm

It is annoying that the dmesg buffer can overflow and loose messages
undetected during debugging. To make clear what happens, count the
dropped bytes and write message buffer full to syslogd. This also
helps to have a reliable log system.
OK deraadt@ millert@ tedu@


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE OPENBSD_5_9_BASE
# 1.10 13-Jan-2015 kettenis

Many architectures call initmsgbuf() really really early, before uvm is
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@


# 1.9 13-Jan-2015 mpf

Add dmesg -s support, to view the output of rc(8) system startup messages.
Help and feedback by Theo and Miod.
OK deraadt@, manpage-ok jmc@


Revision tags: OPENBSD_3_8_BASE OPENBSD_3_9_BASE OPENBSD_4_0_BASE OPENBSD_4_1_BASE OPENBSD_4_2_BASE OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.8 14-Apr-2005 krw

Try to start log message buffer on a new line. Helps install scripts avoid
detecting phantom devices when scanning dmesg output.

Suggested by miod@, ok deraadt@.


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE OPENBSD_3_6_BASE OPENBSD_3_7_BASE SMP_SYNC_A SMP_SYNC_B
# 1.7 02-Jun-2003 millert

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.


Revision tags: OPENBSD_3_2_BASE OPENBSD_3_3_BASE UBC_SYNC_A UBC_SYNC_B
# 1.6 03-Jul-2002 miod

Change all variables definitions (int foo) in sys/sys/*.h to variable
declarations (extern int foo), and compensate in the appropriate locations.


Revision tags: OPENBSD_3_1_BASE
# 1.5 14-Mar-2002 millert

First round of __P removal in sys


Revision tags: OPENBSD_2_7_BASE OPENBSD_2_8_BASE OPENBSD_2_9_BASE OPENBSD_3_0_BASE UBC_BASE
# 1.4 13-Mar-2000 millert

branches: 1.4.10;
Get rid of leading NULs in /kern/msgbuf. If the msgbuf modified in between
reads at just the right time is is possible to get duplicate output but
in practice this is extremely rare. Joint effort with Theo.


# 1.3 22-Feb-2000 deraadt

enlarge msgbuf, somewhat line netbsd did


Revision tags: OPENBSD_2_0_BASE OPENBSD_2_1_BASE OPENBSD_2_2_BASE OPENBSD_2_3_BASE OPENBSD_2_4_BASE OPENBSD_2_5_BASE OPENBSD_2_6_BASE SMP_BASE kame_19991208
# 1.2 03-Mar-1996 niklas

branches: 1.2.16;
From NetBSD: 960217 merge


# 1.1 18-Oct-1995 deraadt

branches: 1.1.1;
Initial revision