The philosophy of errno

From: Paulo da Silva (psXdaXsilva_at_esotericaX.ptX)
Date: 02/09/05


Date: Wed, 09 Feb 2005 20:21:10 +0000

Hello:

Suppose a function that needs to return an error
condition using errno.

What is the good programming for this?

Do I need to clear errno in case of *NO* error?

Or is just enough to return some non-zero value and
set errno to the appropriate code in case of error
and return zero if no error occured don't caring about
errno in this case?

TIA
Paulo