home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.2 (Developer) / NS_dev_3.2.iso / NextDeveloper / Headers / bsd / sys / errno.h < prev    next >
C/C++ Source or Header  |  1993-10-19  |  7KB  |  209 lines

  1. /* 
  2.  * Mach Operating System
  3.  * Copyright (c) 1987 Carnegie-Mellon University
  4.  * All rights reserved.  The CMU software License Agreement specifies
  5.  * the terms and conditions for use and redistribution.
  6.  */
  7.  
  8. /* HISTORY
  9.  *  7-Jan-93  Mac Gillon (mgillon) at NeXT
  10.  *    Integrated POSIX changes
  11.  */
  12. /*
  13.  * Copyright (c) 1982, 1986 Regents of the University of California.
  14.  * All rights reserved.  The Berkeley software License Agreement
  15.  * specifies the terms and conditions for redistribution.
  16.  *
  17.  *    @(#)errno.h    7.1 (Berkeley) 6/4/86
  18.  */
  19.  
  20. /* @(#)errno.h    2.1 88/05/18 4.0NFSSRC SMI;    from UCB 7.1 06/04/86    */
  21.  
  22. #ifndef    _ERRNO_
  23. #define    _ERRNO_    1
  24.  
  25. #ifndef KERNEL
  26.     #include <ansi/standards.h>
  27. #endif
  28.  
  29. /*
  30.  * Error codes
  31.  */
  32.  
  33. #if defined(_POSIX_SOURCE) || defined(_NEXT_SOURCE)
  34.     #define    EPERM         1    /* Not owner */
  35.     #define    ENOENT         2    /* No such file or directory */
  36.     #define    ESRCH         3    /* No such process */
  37.     #define    EINTR         4    /* Interrupted system call */
  38.     #define    EIO         5    /* I/O error */
  39.     #define    ENXIO         6    /* No such device or address */
  40.     #define    E2BIG         7    /* Arg list too long */
  41.     #define    ENOEXEC         8    /* Exec format error */
  42.     #define    EBADF         9    /* Bad file number */
  43.     #define    ECHILD        10    /* No children */
  44.     #define    EAGAIN        11    /* No more processes */
  45.     #define    ENOMEM        12    /* Not enough core */
  46.     #define    EACCES        13    /* Permission denied */
  47.     #define    EFAULT        14    /* Bad address */
  48. #endif /* _POSIX_SOURCE || _NEXT_SOURCE */
  49.  
  50. #ifdef _NEXT_SOURCE
  51.     #define    ENOTBLK        15    /* Block device required */
  52. #endif /* _NEXT_SOURCE */
  53.  
  54. #if defined(_POSIX_SOURCE) || defined(_NEXT_SOURCE)
  55.     #define    EBUSY        16    /* Mount device busy */
  56.     #define    EEXIST        17    /* File exists */
  57.     #define    EXDEV        18    /* Cross-device link */
  58.     #define    ENODEV        19    /* No such device */
  59.     #define    ENOTDIR        20    /* Not a directory*/
  60.     #define    EISDIR        21    /* Is a directory */
  61.     #define    EINVAL        22    /* Invalid argument */
  62.     #define    ENFILE        23    /* File table overflow */
  63.     #define    EMFILE        24    /* Too many open files */
  64.     #define    ENOTTY        25    /* Not a typewriter */
  65. #endif /* _POSIX_SOURCE || _NEXT_SOURCE */
  66.  
  67. #ifdef _NEXT_SOURCE
  68.     #define    ETXTBSY        26    /* Text file busy */
  69. #endif /* _NEXT_SOURCE */
  70.  
  71. #if defined(_POSIX_SOURCE) || defined(_NEXT_SOURCE)
  72.     #define    EFBIG        27    /* File too large */
  73.     #define    ENOSPC        28    /* No space left on device */
  74.     #define    ESPIPE        29    /* Illegal seek */
  75.     #define    EROFS        30    /* Read-only file system */
  76.     #define    EMLINK        31    /* Too many links */
  77.     #define    EPIPE        32    /* Broken pipe */
  78. #endif /* _POSIX_SOURCE || _NEXT_SOURCE */
  79.  
  80. #if defined(__STRICT_ANSI__) || defined(_NEXT_SOURCE) 
  81.     /* math software */
  82.     #define    EDOM        33    /* Argument too large */
  83.     #define    ERANGE        34    /* Result too large */
  84. #endif /* __STRICT_ANSI__ || _NEXT_SOURCE  */
  85.  
  86. #ifdef _NEXT_SOURCE
  87.     /* non-blocking and interrupt i/o */
  88.     #define    EWOULDBLOCK    35    /* Operation would block */
  89.     #define    EINPROGRESS    36    /* Operation now in progress */
  90.     #define    EALREADY    37    /* Operation already in */
  91.                     /* progress */
  92.     
  93.     /* ipc/network software */
  94.  
  95.         /* argument errors */
  96.     #define    ENOTSOCK    38    /* Socket operation on */
  97.                     /* non-socket */
  98.     #define    EDESTADDRREQ    39    /* Destination address */
  99.                     /* required */
  100.     #define    EMSGSIZE    40    /* Message too long */
  101.     #define    EPROTOTYPE    41    /* Protocol wrong type for */
  102.                     /* socket */
  103.     #define    ENOPROTOOPT    42    /* Protocol not available */
  104.     #define    EPROTONOSUPPORT    43    /* Protocol not supported */
  105.     #define    ESOCKTNOSUPPORT    44    /* Socket type not supported */
  106.     #define    EOPNOTSUPP    45    /* Operation not supported */
  107.                     /* on socket */
  108.     #define    EPFNOSUPPORT    46    /* Protocol family */
  109.                     /* not supported */
  110.     #define    EAFNOSUPPORT    47    /* Address family */
  111.                     /* not supported by */
  112.                     /* protocol family */
  113.     #define    EADDRINUSE    48    /* Address already in use */
  114.     #define    EADDRNOTAVAIL    49    /* Can't assign requested */
  115.                     /* address */
  116.  
  117.         /* operational errors */
  118.     #define    ENETDOWN    50    /* Network is down */
  119.     #define    ENETUNREACH    51    /* Network is unreachable */
  120.     #define    ENETRESET    52    /* Network dropped */
  121.                     /* connection on reset */
  122.     #define    ECONNABORTED    53    /* Software caused */
  123.                     /* connection abort */
  124.     #define    ECONNRESET    54    /* Connection reset by peer */
  125.     #define    ENOBUFS        55    /* No buffer space available */
  126.     #define    EISCONN        56    /* Socket is already */
  127.                     /* connected */
  128.     #define    ENOTCONN    57    /* Socket is not connected */
  129.     #define    ESHUTDOWN    58    /* Can't send after */
  130.                     /* socket shutdown */
  131.     #define    ETOOMANYREFS    59    /* Too many references: */
  132.                     /* can't splice */
  133.     #define    ETIMEDOUT    60    /* Connection timed out */
  134.     #define    ECONNREFUSED    61    /* Connection refused */
  135.  
  136.         /* */
  137.     #define    ELOOP        62    /* Too many levels of */
  138.                     /* symbolic links */
  139. #endif /* _NEXT_SOURCE */
  140.  
  141. #if defined(_POSIX_SOURCE) || defined(_NEXT_SOURCE)
  142.     #define    ENAMETOOLONG    63    /* File name too long */
  143. #endif /* _POSIX_SOURCE || _NEXT_SOURCE */
  144.  
  145. #ifdef _NEXT_SOURCE
  146.     /* should be rearranged */
  147.     #define    EHOSTDOWN    64    /* Host is down */
  148.     #define    EHOSTUNREACH    65    /* No route to host */
  149. #endif /* _NEXT_SOURCE */
  150.  
  151. #if defined(_POSIX_SOURCE) || defined(_NEXT_SOURCE)
  152.     #define    ENOTEMPTY    66    /* Directory not empty */
  153. #endif /* _POSIX_SOURCE || _NEXT_SOURCE */
  154.  
  155. #ifdef _NEXT_SOURCE
  156.     /* quotas & mush */
  157.     #define    EPROCLIM    67    /* Too many processes */
  158.     #define    EUSERS        68    /* Too many users */
  159.     #define    EDQUOT        69    /* Disc quota exceeded */
  160.  
  161.     /* SUN_NFS */
  162.     /* Network File System */
  163.     #define    ESTALE        70    /* Stale NFS file handle */
  164.     #define    EREMOTE        71    /* Too many levels of */
  165.                     /* remote in path */
  166.     /* SUN_NFS */
  167. #endif /* _NEXT_SOURCE */
  168.  
  169. #if defined(_POSIX_SOURCE) || defined(_NEXT_SOURCE)
  170.     /* SUN_LOCK */
  171.     /* SystemV Record Locking */
  172.     #define EDEADLK         78    /* Deadlock condition. */
  173.     #define ENOLCK          79    /* No record locks available. */
  174.     /* SUN_LOCK */
  175. #endif /* _POSIX_SOURCE || _NEXT_SOURCE */
  176.  
  177. #ifdef _NEXT_SOURCE
  178.     /* Intelligent device errors */
  179.     #define    EPWROFF        80    /* Device power is off */
  180.     #define    EDEVERR        81    /* Device error, */
  181.                     /* e.g. paper out */
  182.     #define    ENOINIT        82    /* Device not initialized */
  183.  
  184.     /* Program loading errors */
  185.     #define EBADEXEC    83    /* Bad executable */
  186.     /* Program loading errors */
  187.     #define EBADARCH    84    /* Bad CPU type in executable */
  188.     #define ESHLIBVERS    85    /* Shared library version mismatch */
  189.     #define EBADMACHO    86    /* Malformed Macho file */
  190. #endif /* _NEXT_SOURCE */
  191.  
  192. #ifdef _POSIX_SOURCE
  193.     #define    ENOSYS        87    /* Function not implemented. */
  194. #endif    /* _POSIX_SOURCE */
  195.  
  196. #if defined(_NEXT_SOURCE) && defined(__STDC__) && \
  197.       !defined(KERNEL) && !defined(ASSEMBLER)
  198.     #ifdef __STRICT_BSD__
  199.         extern int errno;
  200.     #else
  201.         #import <stddef.h>
  202.     #endif /* __STRICT_BSD__ */
  203.  
  204.     extern void perror(const char *);
  205.     extern char *sys_errlist[];
  206.     extern int sys_nerr;
  207. #endif /* _NEXT_SOURCE && __STDC__ && !KERNEL && !ASSEMBLER */
  208. #endif /* _ERRNO_ */
  209.