ERRNO(3)                Library functions                ERRNO(3)

       errno - number of last error

       #include <errno.h>

       extern int errno;

       The integer errno is set by system calls (and some library
       functions) to indicate what went wrong.  Its value is sig-
       nificant  only  when  the  call returned an error (usually
       -1), and a library function that does succeed  is  allowed
       to change errno.

       Sometimes, when -1 is also a legal return value one has to
       zero errno before the call in  order  to  detect  possible

       errno  is defined by the ISO C standard to be a modifiable
       lvalue of type int, and must not be  explicitly  declared;
       errno  may  be a macro.  errno is thread-local; setting it
       in one thread does not  affect  its  value  in  any  other

       Valid  error  numbers are all non-zero; errno is never set
       to zero by any library  function.   All  the  error  names
       specified by POSIX.1 must have distinct values.

       POSIX.1  (1996 edition) lists the following symbolic error
       names.  Of these, EDOM and ERANGE are in the ISO  C  stan-
       dard.  ISO C Amendment 1 defines the additional error num-
       ber EILSEQ for coding errors in multibyte or wide  charac-

       E2BIG  Arg list too long

       EACCES Permission denied

       EAGAIN Resource temporarily unavailable

       EBADF  Bad file descriptor

              Bad message

       EBUSY  Resource busy

              Operation canceled

       ECHILD No child processes

              Resource deadlock avoided

       EDOM   Domain error

       EEXIST File exists

       EFAULT Bad address

       EFBIG  File too large

              Operation in progress

       EINTR  Interrupted function call

       EINVAL Invalid argument

       EIO    Input/output error

       EISDIR Is a directory

       EMFILE Too many open files

       EMLINK Too many links

              Inappropriate message buffer length

              Filename too long

       ENFILE Too many open files in system

       ENODEV No such device

       ENOENT No such file or directory

              Exec format error

       ENOLCK No locks available

       ENOMEM Not enough space

       ENOSPC No space left on device

       ENOSYS Function not implemented

              Not a directory

              Directory not empty

              Not supported

       ENOTTY Inappropriate I/O control operation

       ENXIO  No such device or address

       EPERM  Operation not permitted

       EPIPE  Broken pipe

       ERANGE Result too large

       EROFS  Read-only file system

       ESPIPE Invalid seek

       ESRCH  No such process

              Operation timed out

       EXDEV  Improper link

              Many  other  error  numbers are returned by various
              Unix implementations.   System  V  returns  ETXTBSY
              (Text file busy) if one tries to exec() a file that
              is currently open for writing.  Linux also  returns
              this  error if one tries to have a file both memory
              mapped with VM_DENYWRITE and open for writing.

       perror(3), strerror(3)

                          30 March 1998                         1