From: Dan K. <da...@ke...> - 2003-07-04 22:21:31
|
Matthew Emmerton wrote: > I was reviewing the source to corecheck/tests/sigkill.c the other day and > noticed some questionable code, namely: > > a) setting errno = 0. errno should never be set by user applications (as > per SUSv3) You may have misread the standard. I just checked http://www.opengroup.org/onlinepubs/007904975/functions/errno.html and it says that no Unix library or system call will clear errno; it doesn't say the app can't. In fact, it suggests it's ok for the app to: "An application that needs to examine the value of errno to determine the error should set it to 0 before a function call, then inspect it before a subsequent function call." - Dan -- Dan Kegel http://www.kegel.com http://counter.li.org/cgi-bin/runscript/display-person.cgi?user=78045 |