On Mon, Sep 16, 2013 at 12:33:29PM -0400, Hiram Chirino wrote: > Do other APIs reset the errno? I could have sworn they didn't.
"Successful system calls and library functions never reset errno to 0, so this variable may have a nonzero value as a consequence of an error from a previous call. Furthermore, SUSv3 permits a successful function call to set errno to a nonzero value (although few functions do this). Therefore, when checking for an error, we should always first check if the function return value indicates an error, and only then examine errno to determine the cause of the error." - The Linux Programming Interface, pg 49. -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/
pgpEFRS5MxPIW.pgp
Description: PGP signature
