1 /** @file
2   The header <sys/errno.h> defines several values, all relating to the reporting of
3   error conditions.
4 
5   The enum members expand to integral constant expressions
6   with distinct nonzero values, suitable for use in #if preprocessing
7   directives.  These default values are specified as an enum in order to ease
8   the maintenance of the values.
9 
10   Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR>
11   This program and the accompanying materials are licensed and made available under
12   the terms and conditions of the BSD License that accompanies this distribution.
13   The full text of the license may be found at
14   http://opensource.org/licenses/bsd-license.
15 
16   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
17   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 **/
19 #ifdef  _ERRNO_H          // May only be included from <errno.h>
20 #ifndef _SYS_ERRNO_H
21 #define _SYS_ERRNO_H
22 
23 /* Define the error numbers, sequentially, beginning at 1. */
24 enum {
25   __ESUCCESS      = 0,              /*  0   For those rare times one needs to say all is OK */
26   __EMINERRORVAL  = 1,              /* The lowest valid error value */
27   __EPERM         = __EMINERRORVAL, /*  1   Operation not permitted */
28   __ENOENT,                         /*  2   No such file or directory */
29   __ESRCH,                          /*  3   No such process */
30   __EINTR,                          /*  4   Interrupted system call */
31   __EIO,                            /*  5   Input/output error */
32   __ENXIO,                          /*  6   Device not configured */
33   __E2BIG,                          /*  7   Argument list too long */
34   __ENOEXEC,                        /*  8   Exec format error */
35   __EBADF,                          /*  9   Bad file descriptor */
36   __ECHILD,                         /* 10   No child processes */
37   __EDEADLK,                        /* 11   Resource deadlock avoided */
38   __ENOMEM,                         /* 12   Cannot allocate memory */
39   __EACCES,                         /* 13   Permission denied */
40   __EFAULT,                         /* 14   Bad address */
41   __ENOTBLK,                        /* 15   Block device required */
42   __EBUSY,                          /* 16   Device busy */
43   __EEXIST,                         /* 17   File exists */
44   __EXDEV,                          /* 18   Cross-device link */
45   __ENODEV,                         /* 19   Operation not supported by device */
46   __ENOTDIR,                        /* 20   Not a directory */
47   __EISDIR,                         /* 21   Is a directory */
48   __EINVAL,                         /* 22   Invalid argument */
49   __ENFILE,                         /* 23   Too many open files in system */
50   __EMFILE,                         /* 24   Too many open file descriptors */
51   __ENOTTY,                         /* 25   Inappropriate ioctl for device */
52   __ETXTBSY,                        /* 26   Text file busy */
53   __EFBIG,                          /* 27   File too large */
54   __ENOSPC,                         /* 28   No space left on device */
55   __ESPIPE,                         /* 29   Illegal seek */
56   __EROFS,                          /* 30   Read-only filesystem */
57   __EMLINK,                         /* 31   Too many links */
58   __EPIPE,                          /* 32   Broken pipe */
59 
60   /* math software -- these are the only two values required by the C Standard */
61   __EDOM,                           /* 33   Numerical argument out of domain */
62   __ERANGE,                         /* 34   Result too large */
63 
64   /* non-blocking and interrupt i/o */
65   __EAGAIN,                         /* 35   Resource temporarily unavailable */
66   __EWOULDBLOCK     = __EAGAIN,     /* 35   Operation would block */
67   __EINPROGRESS,                    /* 36   Operation now in progress */
68   __EALREADY,                       /* 37   Operation already in progress */
69 
70   /* ipc/network software -- argument errors */
71   __ENOTSOCK,                       /* 38   Socket operation on non-socket */
72   __EDESTADDRREQ,                   /* 39   Destination address required */
73   __EMSGSIZE,                       /* 40   Message too long */
74   __EPROTOTYPE,                     /* 41   Protocol wrong type for socket */
75   __ENOPROTOOPT,                    /* 42   Protocol not available */
76   __EPROTONOSUPPORT,                /* 43   Protocol not supported */
77   __ESOCKTNOSUPPORT,                /* 44   Socket type not supported */
78   __EOPNOTSUPP,                     /* 45   Operation not supported */
79   __ENOTSUP         = __EOPNOTSUPP, /* 45   Operation not supported */
80   __EPFNOSUPPORT,                   /* 46   Protocol family not supported */
81   __EAFNOSUPPORT,                   /* 47   Address family not supported by protocol family */
82   __EADDRINUSE,                     /* 48   Address already in use */
83   __EADDRNOTAVAIL,                  /* 49   Can't assign requested address */
84 
85   /* ipc/network software -- operational errors */
86   __ENETDOWN,                       /* 50   Network is down */
87   __ENETUNREACH,                    /* 51   Network is unreachable */
88   __ENETRESET,                      /* 52   Network dropped connection on reset */
89   __ECONNABORTED,                   /* 53   Software caused connection abort */
90   __ECONNRESET,                     /* 54   Connection reset by peer */
91   __ENOBUFS,                        /* 55   No buffer space available */
92   __EISCONN,                        /* 56   Socket is already connected */
93   __ENOTCONN,                       /* 57   Socket is not connected */
94   __ESHUTDOWN,                      /* 58   Can't send after socket shutdown */
95   __ETOOMANYREFS,                   /* 59   Too many references: can't splice */
96   __ETIMEDOUT,                      /* 60   Operation timed out */
97   __ECONNREFUSED,                   /* 61   Connection refused */
98   __ELOOP,                          /* 62   Too many levels of symbolic links */
99   __ENAMETOOLONG,                   /* 63   File name too long */
100   __EHOSTDOWN,                      /* 64   Host is down */
101   __EHOSTUNREACH,                   /* 65   No route to host */
102 
103   __ENOTEMPTY,                      /* 66   Directory not empty */
104 
105   /* quotas, etc. */
106   __EPROCLIM,                       /* 67   Too many processes */
107   __EUSERS,                         /* 68   Too many users */
108   __EDQUOT,                         /* 69   Disc quota exceeded */
109 
110   /* Network File System */
111   __ESTALE,                         /* 70   Stale NFS file handle */
112   __EREMOTE,                        /* 71   Too many levels of remote in path */
113   __EBADRPC,                        /* 72   RPC struct is bad */
114   __ERPCMISMATCH,                   /* 73   RPC version wrong */
115   __EPROGUNAVAIL,                   /* 74   RPC prog. not avail */
116   __EPROGMISMATCH,                  /* 75   Program version wrong */
117   __EPROCUNAVAIL,                   /* 76   Bad procedure for program */
118   __ENOLCK,                         /* 77   No locks available */
119   __ENOSYS,                         /* 78   Function not implemented */
120   __EFTYPE,                         /* 79   Inappropriate file type or format */
121   __EAUTH,                          /* 80   Authentication error */
122   __ENEEDAUTH,                      /* 81   Need authenticator */
123   __EIDRM,                          /* 82   Identifier removed */
124   __ENOMSG,                         /* 83   No message of desired type */
125   __EOVERFLOW,                      /* 84   Value too large to be stored in data type */
126   __EILSEQ,                         /* 85   Illegal byte sequence */
127   __ENOTHING_1,                     /* 86   Place Holder */
128   __ECANCELED,                      /* 87   Operation canceled */
129 
130   __EBADMSG,                        /* 88   Bad message */
131   __ENODATA,                        /* 89   No message available */
132   __ENOSR,                          /* 90   No STREAM resources */
133   __ENOSTR,                         /* 91   Not a STREAM */
134   __ETIME,                          /* 92   STREAM ioctl timeout */
135 
136   __ENOATTR,                        /* 93   Attribute not found */
137 
138   __EDOOFUS,                        /* 94   Programming error */
139 
140   __EMULTIHOP,                      /* 95   Multihop attempted */
141   __ENOLINK,                        /* 96   Link has been severed */
142   __EPROTO,                         /* 97   Protocol error */
143 
144   __EBUFSIZE,                       /* 98   Buffer too small to hold result */
145 
146   __EMAXERRORVAL                    /* One more than the highest defined error value. */
147 };
148 
149 #endif  /* _SYS_ERRNO_H */
150 #else   /* not defined _ERRNO_H */
151 #error  <sys/errno.h> must only be included by <errno.h>.
152 #endif  /* _ERRNO_H */
153