C Language and Libraries Help (clang.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
perror
 Summary Example                         Up Contents Index Back
─────Run-Time Library───────────────────────────────────────────────────────
 
     The perror function prints an error message to stderr. The
     <string> argument is printed first, followed by a colon, the
     system error message for the last library call that produced the
     error, and a newline character. If <string> is a null pointer or a
     pointer to a null string, perror prints only the system error
     message.
 
     The actual error number is stored in the variable errno (defined
     in ERRNO.H). The system error messages are accessed through the
     variable _sys_errlist, which is an array of messages ordered by
     error number. The perror function prints the appropriate error
     message by using the errno value as an index to _sys_errlist. The
     value of the variable _sys_nerr is defined as the maximum number
     of elements in the _sys_errlist array.
 
     To produce accurate results, perror should be called immediately
     after a library routine returns with an error. Otherwise, the
     errno value may be overwritten by subsequent calls.
 
     Under DOS, some of the errno values listed in ERRNO.H are not
     used. The perror function prints an empty string for any errno
     value not used under the operating system.
 
     Return Value
 
     None.
                                    -♦-