Printf sets errno to 25?
Doug Gwyn <gwyn>
gwyn at brl-tgr.ARPA
Mon Dec 16 11:28:00 AEST 1985
isatty() is not the only culprit; other "section 3"
C library routines also can set errno as a side-effect
of successful operation. (This can legitimately be
considered a misfeature, but that's the way it is.)
You should only test errno when a system call (section
2 routine) returns an error indication. Nothing in
the C library should ever set errno to 0, although
if the misfeature were to be corrected some routines
would have to save and restore errno.
More information about the Comp.unix.wizards
mailing list