aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2024-08-13 15:52:34 +0200
committerFlorian Weimer <fweimer@redhat.com>2024-08-13 15:52:34 +0200
commit0e16db440cc73d2cdd94e439c0efa1ec43d92b2a (patch)
treeb9652410f1ea2fd179634b8b49d35b1199750b2f
parentcf03971f7a9b1d5f2d6565781d22dc777864998e (diff)
downloadglibc-0e16db440cc73d2cdd94e439c0efa1ec43d92b2a.zip
glibc-0e16db440cc73d2cdd94e439c0efa1ec43d92b2a.tar.gz
glibc-0e16db440cc73d2cdd94e439c0efa1ec43d92b2a.tar.bz2
manual: Document generic printf error codes
Describe EOVERFLOW, ENOMEN, EILSEQ. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
-rw-r--r--manual/stdio.texi23
1 files changed, 23 insertions, 0 deletions
diff --git a/manual/stdio.texi b/manual/stdio.texi
index 8517653..73d20d9 100644
--- a/manual/stdio.texi
+++ b/manual/stdio.texi
@@ -2356,6 +2356,29 @@ the easiest way to make sure you have all the right prototypes is to
just include @file{stdio.h}.
@pindex stdio.h
+The @code{printf} family shares the error codes listed below.
+Individual functions may report additional @code{errno} values if they
+fail.
+
+@table @code
+@item EOVERFLOW
+The number of written bytes would have exceeded @code{INT_MAX}, and thus
+could not be represented in the return type @code{int}.
+
+@item ENOMEM
+The function could not allocate memory during processing. Long argument
+lists and certain floating point conversions may require memory
+allocation, as does initialization of an output stream upon first use.
+
+@item EILSEQ
+POSIX specifies this error code should be used if a wide character is
+encountered that does not have a matching valid character. @Theglibc{}
+always performs transliteration, using a replacement character if
+necessary, so this error condition cannot occur on output. However,
+@theglibc{} uses @code{EILSEQ} to indicate that an input character
+sequence (wide or multi-byte) could not be converted successfully.
+@end table
+
@deftypefun int printf (const char *@var{template}, @dots{})
@standards{ISO, stdio.h}
@safety{@prelim{}@mtsafe{@mtslocale{}}@asunsafe{@asucorrupt{} @ascuheap{}}@acunsafe{@acsmem{} @aculock{} @acucorrupt{}}}