Unformatted text preview: sys_nerr-1. Be careful when directly accessing this list because new error values may not have been added to sys_errlist . When a system call fails, it usually returns -1 and sets the variable errno to a value describing what went wrong. (These values can be found in <errno.h> .) Many library functions do likewise. The function per-ror() serves to translate this error code into human-readable form. Note that errno is undefined after a suc-cessful library call: this call may well change this variable, even though it succeeds, for example because it internally used some other library function that failed. Thus, if a failing call is not immediately followed by a call to perror , the value of errno should be saved. CONFORMING TO ANSI C, BSD 4.3, POSIX, X/OPEN SEE ALSO strerror (3) May 16 1996 1...
View Full Document
- Spring '06
- System Call, ASCII, external variable errno, variable errno