This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Fix BZ # 2074
- From: Andreas Jaeger <aj at suse dot de>
- To: libc-alpha at sourceware dot org
- Date: Wed, 11 Apr 2012 09:54:25 +0200
- Subject: Fix BZ # 2074
There's been a lengthy discussion in bugzilla around bz#2074 which ended
with the conclusion that the documentation for the write function used with
fopencookie must not return a negative value.
Fixed with the appended patch.
Ok to commit?
Andreas
2012-04-11 Petr Baudis <pasky@ucw.cz>
[BZ #2074]
* stdio.texi (Hook Functions): The user provided writer function
is not allowed to return -1.
diff --git a/manual/stdio.texi b/manual/stdio.texi
index e870afb..c58ca22 100644
--- a/manual/stdio.texi
+++ b/manual/stdio.texi
@@ -5021,7 +5021,8 @@ ssize_t @var{writer} (void *@var{cookie}, const char *@var{buffer}, size_t @var{
This is very similar to the @code{write} function; see @ref{I/O
Primitives}. Your function should transfer up to @var{size} bytes from
the buffer, and return the number of bytes written. You can return a
-value of @code{-1} to indicate an error.
+value of @code{0} to indicate an error. You must not return any
+negative value.
You should define the function to perform seek operations on the cookie
as:
--
Andreas Jaeger aj@{suse.com,opensuse.org} Twitter/Identica: jaegerandi
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 NÃrnberg, Germany
GF: Jeff Hawn,Jennifer Guild,Felix ImendÃrffer,HRB16746 (AG NÃrnberg)
GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126