summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio/printf.3
diff options
context:
space:
mode:
authortjr <tjr@FreeBSD.org>2002-12-20 08:28:10 +0000
committertjr <tjr@FreeBSD.org>2002-12-20 08:28:10 +0000
commit08218617f475dff61ed68f3d0803efe63c59525d (patch)
tree7cf91df7dd9f6d66d4ca27971695a0f558b48ff2 /lib/libc/stdio/printf.3
parent9b26000e8df20bd325528f90c3529c0197eb5488 (diff)
downloadFreeBSD-src-08218617f475dff61ed68f3d0803efe63c59525d.zip
FreeBSD-src-08218617f475dff61ed68f3d0803efe63c59525d.tar.gz
Document the fact that the printf() family of functions return negative
values (EOF in our case) on error, and some of the possible errno values in an Errors section. PR: 39257
Diffstat (limited to 'lib/libc/stdio/printf.3')
-rw-r--r--lib/libc/stdio/printf.316
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/libc/stdio/printf.3 b/lib/libc/stdio/printf.3
index f5848dd..7e73f24 100644
--- a/lib/libc/stdio/printf.3
+++ b/lib/libc/stdio/printf.3
@@ -36,7 +36,7 @@
.\" @(#)printf.3 8.1 (Berkeley) 6/4/93
.\" $FreeBSD$
.\"
-.Dd November 8, 2001
+.Dd December 20, 2002
.Dt PRINTF 3
.Os
.Sh NAME
@@ -111,7 +111,7 @@ are converted for output.
These functions return the number of characters printed
(not including the trailing
.Ql \e0
-used to end output to strings),
+used to end output to strings) or a negative value if an output error occurs,
except for
.Fn snprintf
and
@@ -767,6 +767,18 @@ for later interpolation by
Always use the proper secure idiom:
.Pp
.Dl "snprintf(buffer, sizeof(buffer), \*q%s\*q, string);"
+.Sh ERRORS
+In addition to the errors documented for the
+.Xr write 2
+system call, the
+.Fn printf
+family of functions may fail if:
+.Bl -tag -width Er
+.It Bq Er EILSEQ
+An invalid wide character code was encountered.
+.It Bq Er ENOMEM
+Insufficient storage space is available.
+.El
.Sh SEE ALSO
.Xr printf 1 ,
.Xr fmtcheck 3 ,
OpenPOWER on IntegriCloud