Implement sbuf_prf(), which takes an sbuf and outputs it
authorscottl <scottl@FreeBSD.org>
Tue, 28 Feb 2017 18:25:06 +0000 (18:25 +0000)
committerscottl <scottl@FreeBSD.org>
Tue, 28 Feb 2017 18:25:06 +0000 (18:25 +0000)
commit0a682607847b7b7a320c7e81a620b68634a692f7
tree2348634f666de456fdc532561183758e6480b2e7
parentbb1a4fb6c36ed4ee332f5a8ed0e20f2947c03401
Implement sbuf_prf(), which takes an sbuf and outputs it
to stdout in the non-kernel case and to the console+log
in the kernel case.  For the kernel case it hooks the
putbuf() machinery underneath printf(9) so that the buffer
is written completely atomically and without a copy into
another temporary buffer.  This is useful for fixing
compound console/log messages that become broken and
interleaved when multiple threads are competing for the
console.

Reviewed by: ken, imp
Sponsored by: Netflix
share/man/man9/sbuf.9
sys/kern/subr_prf.c