summaryrefslogtreecommitdiffstats
path: root/share/man
diff options
context:
space:
mode:
authormdf <mdf@FreeBSD.org>2010-09-10 16:42:16 +0000
committermdf <mdf@FreeBSD.org>2010-09-10 16:42:16 +0000
commitab3a8b533a824bceba3baf79642745d2b57f4c9d (patch)
treee9bea66185b980482df09793bce47717d6df59f2 /share/man
parentd0cd039a30daea0e7c8a5089793befb261d13de1 (diff)
downloadFreeBSD-src-ab3a8b533a824bceba3baf79642745d2b57f4c9d.zip
FreeBSD-src-ab3a8b533a824bceba3baf79642745d2b57f4c9d.tar.gz
Replace sbuf_overflowed() with sbuf_error(), which returns any error
code associated with overflow or with the drain function. While this function is not expected to be used often, it produces more information in the form of an errno that sbuf_overflowed() did.
Diffstat (limited to 'share/man')
-rw-r--r--share/man/man9/Makefile2
-rw-r--r--share/man/man9/sbuf.919
2 files changed, 13 insertions, 8 deletions
diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile
index 6abafe1..194eba4 100644
--- a/share/man/man9/Makefile
+++ b/share/man/man9/Makefile
@@ -1025,10 +1025,10 @@ MLINKS+=sbuf.9 sbuf_bcat.9 \
sbuf.9 sbuf_data.9 \
sbuf.9 sbuf_delete.9 \
sbuf.9 sbuf_done.9 \
+ sbuf.9 sbuf_error.9 \
sbuf.9 sbuf_finish.9 \
sbuf.9 sbuf_len.9 \
sbuf.9 sbuf_new.9 \
- sbuf.9 sbuf_overflowed.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 7389064..0b6aa90 100644
--- a/share/man/man9/sbuf.9
+++ b/share/man/man9/sbuf.9
@@ -45,7 +45,7 @@
.Nm sbuf_putc ,
.Nm sbuf_set_drain ,
.Nm sbuf_trim ,
-.Nm sbuf_overflowed ,
+.Nm sbuf_error ,
.Nm sbuf_finish ,
.Nm sbuf_data ,
.Nm sbuf_len ,
@@ -88,7 +88,7 @@
.Ft int
.Fn sbuf_trim "struct sbuf *s"
.Ft int
-.Fn sbuf_overflowed "struct sbuf *s"
+.Fn sbuf_error "struct sbuf *s"
.Ft int
.Fn sbuf_finish "struct sbuf *s"
.Ft char *
@@ -332,10 +332,15 @@ function removes trailing whitespace from the
.Fa sbuf .
.Pp
The
-.Fn sbuf_overflowed
-function returns a non-zero value if the
+.Fn sbuf_error
+function returns any error value that the
+.Fa sbuf
+may have accumulated, either from the drain function, or ENOMEM if the
.Fa sbuf
overflowed.
+This function is generally not needed and instead the error code from
+.Fn sbuf_finish
+is the preferred way to discover whether an sbuf had an error.
.Pp
The
.Fn sbuf_finish
@@ -437,9 +442,9 @@ functions
all return \-1 if the buffer overflowed, and zero otherwise.
.Pp
The
-.Fn sbuf_overflowed
-function
-returns a non-zero value if the buffer overflowed, and zero otherwise.
+.Fn sbuf_error
+function returns a non-zero value if the buffer has an overflow or
+drain error, and zero otherwise.
.Pp
The
.Fn sbuf_data
OpenPOWER on IntegriCloud