Printf sets errno to 25?

Joseph S. D. Yao jsdy at hadron.UUCP
Thu Dec 26 08:49:07 AEST 1985


As Gwyn and Merritt point out, the value of errno is not guaranteed
to be meaningful except under certain circumstances, e.g., failed
system calls.  The reason it gets set at all inside printf() is that
printf() checks stdout for tty-ness and, if it is not a tty, buffers
output.  Otherwise, depending on the version of UNIX, it line-buffers
it or does not buffer it at all.  Again depending on the version of
UNIX, roughly the same may be true of stdin.  I believe (and I know
Doug'll hit me if I'm wrong) that stderr is always unbuffered.
-- 

	Joe Yao		hadron!jsdy at seismo.{CSS.GOV,ARPA,UUCP}



More information about the Comp.unix.wizards mailing list