Document sbuf_new_for_sysctl(9).

Pointed out by:	lstewart
This commit is contained in:
Matthew D Fleming
2011-01-25 17:39:52 +00:00
parent 965615476e
commit 7c2dd57bdb
2 changed files with 15 additions and 1 deletions
+1
View File
@@ -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 \
+14 -1
View File
@@ -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