_sys_errlist

De RAD Studio
Aller à : navigation, rechercher

Remonter à errno.h - Index


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 values stored in _sys_errlist. The list is alphabetically ordered for ease your reading convenience. For the numerical ordering, see the header file errno.h.


Mnemonic Description

E2BIG

Arg list too long

EACCES

Permission denied

EBADF

Bad file number

ECHILD

No child process

ECONTR

Memory blocks destroyed

ECURDIR

Attempt to remove CurDir

EDEADLOCK

Locking violation

EDOM

Math argument

EEXIST

File already exists

EFAULT

Unknown error

EINTR

Interrupted function call

EINVACC

Invalid access code

EINVAL

Invalid argument

EINVDAT

Invalid data

EINVDRV

Invalid drive specified

EINVENV

Invalid environment

EINVFMT

Invalid format

EINVFNC

Invalid function number

EINVMEM

Invalid memory block address

EIO

input/output error

EMFILE

Too many open files

ENAMETOOLONG

ENAMETOOLONG

ENFILE

Too many open files

ENMFILE

No more files

ENODEV

No such device

ENOENT

No such file or directory

ENOEXEC

Exec format error

ENOFILE

File not found

ENOMEM

Not enough core

ENOPATH

Path not found

ENOSPC

No space left on device

ENOTSAM

Not same device

ENXIO

No such device or address

EPERM

Operation not permitted

EPIPE

Broken pipe

ERANGE

Result too large

EROFS

Read-only file system

ESPIPE

Illegal seek

EXDEV

Cross-device link

EZERO

Error 0


Example

#include <errno.h>
#include <stdio.h>


int main()
{
   int i = 0;

   // Global value _sys_nerr also defined in errno.h
   while(i < _sys_nerr) {
        printf("%s\n", _sys_errlist[i]);
        i++;
   }
   return 0;
}