return value of fprintf

Garrett Wollman wollman at
Mon Jan 22 22:46:50 UTC 2007

<<On Mon, 22 Jan 2007 22:31:50 +0100, Køi¹tof ®elechovski <giecrilj at> said:

> The latter is correct: I get printf("abcd") == 4 even under >/dev/full.
> (uname is Interix on x86 ver. 3.5)

The FreeBSD C library is only supported as an integral part of the
FreeBSD operating system.

> However, the former is not: according to the ANSI C standard
> <> , §,
> printf should return a negative value in this case.

The standard makes no such requirement; neither an encoding error nor
an I/O error can ever be encountered in this example.  The error
condition will not be detected until the stream's buffer is flushed,
as by fflush() or fclose().


More information about the freebsd-standards mailing list