summaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authormdf <mdf@FreeBSD.org>2011-01-25 17:39:52 +0000
committermdf <mdf@FreeBSD.org>2011-01-25 17:39:52 +0000
commit64c19cf589513cd3d7b245538188945dbcc8b5e1 (patch)
tree9e0b51c1296a72d93adf4ceef4eb5364a1e7b910 /share
parentbd51c8de855353878a76b7d2ea6a634d444d4844 (diff)
downloadFreeBSD-src-64c19cf589513cd3d7b245538188945dbcc8b5e1.zip
FreeBSD-src-64c19cf589513cd3d7b245538188945dbcc8b5e1.tar.gz
Document sbuf_new_for_sysctl(9).
Pointed out by: lstewart
Diffstat (limited to 'share')
-rw-r--r--share/man/man9/Makefile1
-rw-r--r--share/man/man9/sbuf.915
2 files changed, 15 insertions, 1 deletions
diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile
index 6366b1f..fdcb106 100644
--- a/share/man/man9/Makefile
+++ b/share/man/man9/Makefile
@@ -1031,6 +1031,7 @@ MLINKS+=sbuf.9 sbuf_bcat.9 \
sbuf.9 sbuf_finish.9 \
sbuf.9 sbuf_len.9 \
sbuf.9 sbuf_new.9 \
+ sbuf.9 sbuf_new_for_sysctl.9 \
sbuf.9 sbuf_printf.9 \
sbuf.9 sbuf_putc.9 \
sbuf.9 sbuf_set_drain.9 \
diff --git a/share/man/man9/sbuf.9 b/share/man/man9/sbuf.9
index 0b6aa90..798b1c8 100644
--- a/share/man/man9/sbuf.9
+++ b/share/man/man9/sbuf.9
@@ -25,13 +25,14 @@
.\"
.\" $FreeBSD$
.\"
-.Dd May 17, 2009
+.Dd January 25, 2011
.Dt SBUF 9
.Os
.Sh NAME
.Nm sbuf ,
.Nm sbuf_new ,
.Nm sbuf_new_auto ,
+.Nm sbuf_new_for_sysctl ,
.Nm sbuf_clear ,
.Nm sbuf_setpos ,
.Nm sbuf_bcat ,
@@ -99,6 +100,9 @@
.Fn sbuf_done "struct sbuf *s"
.Ft void
.Fn sbuf_delete "struct sbuf *s"
+.In sys/sysctl.h
+.Ft struct sbuf *
+.Fn sbuf_new_for_sysctl "struct sbuf *s" "char *buf" "int length" "struct sysctl_req *req"
.Sh DESCRIPTION
The
.Nm
@@ -169,6 +173,15 @@ and
.Dv SBUF_AUTOEXTEND .
.Pp
The
+.Fn sbuf_new_for_sysctl
+function will set up an sbuf with a drain function to use
+.Fn SYSCTL_OUT
+when the internal buffer fills.
+The sysctl old buffer will be wired, which allows for doing an
+.Fn sbuf_printf
+while holding a mutex.
+.Pp
+The
.Fn sbuf_delete
function clears the
.Fa sbuf
OpenPOWER on IntegriCloud