]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
manual: Document generic printf error codes
authorFlorian Weimer <fweimer@redhat.com>
Tue, 13 Aug 2024 13:52:34 +0000 (15:52 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Tue, 13 Aug 2024 13:52:34 +0000 (15:52 +0200)
Describe EOVERFLOW, ENOMEN, EILSEQ.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
manual/stdio.texi

index 8517653507388913f15177f5c89ebe0a904102c8..73d20d9d39605d3563218c4c1f534633ead74357 100644 (file)
@@ -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{}}}