On Sun, Jul 26, 2009 at 08:50:15AM -0600, Jamie Gritton wrote: > All true - and I'll add the check you mention to my patch. > > But what about the malloc case? Is it equally valid to say that errno > should not be set when no error occurred? Or are non-syscall libc > functions generally given free reign to overwrite errno in non-error > situations?
Yes, they have a blanket to override errno when no error is returned to the caller. Malloc is good example. Errno is defined only after error.
pgpPibMH5cX84.pgp
Description: PGP signature