aboutsummaryrefslogtreecommitdiff
path: root/share/man/man9
diff options
context:
space:
mode:
Diffstat (limited to 'share/man/man9')
-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 6abafe19e09f..194eba471376 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 7389064544fa..0b6aa908d079 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