Checking return values (was: Trojan Horses, NFS, etc.)

Ronald S H Khoo ronald at robobar.co.uk
Fri Oct 26 17:18:34 AEST 1990


In article <3648 at skye.ed.ac.uk> richard at aiai.UUCP (Richard Tobin) writes:

> Or else you must save and restore errno.  Is this guaranteed to work?

I had thought not, but apparently the answer is "yes" because 4.1.3
says that errno expands to a "modifiable lvalue" and 4.9.10.4 says that perror()
"maps the error number in the integer expression errno to an error message"

So I guess you're right.  OK.

In <8215:Oct2521:30:3890 at kramden.acf.nyu.edu>,
Dan Bernstein <brnstnd at kramden.acf.nyu.edu> suggested using
sys_errlist[] which is not standard.  I suppose you can always provide
a strerror() written in terms of sys_errlist[] if you don't already have
strerror() [4.11.6.2].  Many people don't have strerror() which is why
I did not mention it previously.  (I have it, though)

-- 
ronald at robobar.co.uk +44 81 991 1142 (O) +44 71 229 7741 (H)



More information about the Comp.unix.programmer mailing list