RAD Studio
ContentsIndex
PreviousUpNext
errno.h

The following functions, macros, and classes are provided in errno.h:

Name 
Description 
Header File
errno.h, math.h
Description
These are the mnemonics and meanings for the error numbers found in math.h and errno.  
Header File
errno.h
Syntax
extern int _doserrno;
Description
_doserrno is a variable that maps many operating system error codes to errno; however, perror does not use _doserrno directly.
When an operating system call results in an error, _doserrno is set to the actual operating system error code. errno is a parallel error variable inherited from UNIX.
The following list gives mnemonics for the actual DOS error codes to which _doserrno can be set. (This value of _doserrno may or may not be mapped (through errno) to an equivalent error message string in _sys_errlist.  
Header File
errno.h
Syntax
extern int errno;
Description
errno is used by perror to print error messages when certain library routines fail to accomplish their appointed tasks.
When an error in a math or system call occurs, errno is set to indicate the type of error. Sometimes errno and _doserrno are equivalent. At other times, errno does not contain the actual operating system error code, which is contained in _doserrno. Still other errors might occur that set only errno, not _doserrno. 
Header File
errno.h
Description
These are the mnemonics and meanings for the error numbers found in errno.
Each value listed can be used to index into the sys_errlist array for displaying messages.
Also, perror will display messages.  
Header File
errno.h, stdio.h
Category
Diagnostic Routines, Input/output Routines
Prototype
void perror(const char *s);
void _wperror(const wchar_t *s);
Description
Prints a system error message.
perror prints to the stderr stream (normally the console) the system error message for the last library routine that set the global variable errno.
It prints the argument s followed by a colon (:) and the message corresponding to the current value of the global variable errno and finally a new line. The convention is to pass the file name of the program as the argument string.
The array of error message strings is accessed through... more 
Header File
errno.h
Syntax
extern char * _sys_errlist[ ];
Description
_sys_errlist is used by perror to print error messages when certain library routines fail to accomplish their appointed tasks.
To provide more control over message formatting, the array of message strings is provided in _sys_errlist. You can use errno as an index into the array to find the string corresponding to the error number. The string does not include any newline character.
Example
printf("%s\n", _sys_errlist[ENOPATH]);
This code statement that uses the Mnemonic ENOPATH will output the string "Path not found".
The following table gives mnemonics and their meanings for the... more 
Header File
errno.h
Syntax
extern int _sys_nerr;
Description
_sys_nerr is used by perror to print error messages when certain library routines fail to accomplish their appointed tasks.
This variable is defined as the number of error message strings in _sys_errlist. 
Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!