1 /*
2  * Copyright (c) 2013-2014 Intel Corporation. All rights reserved.
3  * Copyright (c) 2015 Cisco Systems, Inc. All rights reserved.
4  *
5  * This software is available to you under a choice of one of two
6  * licenses.  You may choose to be licensed under the terms of the GNU
7  * General Public License (GPL) Version 2, available from the file
8  * COPYING in the main directory of this source tree, or the
9  * BSD license below:
10  *
11  *     Redistribution and use in source and binary forms, with or
12  *     without modification, are permitted provided that the following
13  *     conditions are met:
14  *
15  *      - Redistributions of source code must retain the above
16  *        copyright notice, this list of conditions and the following
17  *        disclaimer.
18  *
19  *      - Redistributions in binary form must reproduce the above
20  *        copyright notice, this list of conditions and the following
21  *        disclaimer in the documentation and/or other materials
22  *        provided with the distribution.
23  *
24  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
28  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
29  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
30  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31  * SOFTWARE.
32  */
33 
34 #ifndef FI_ERRNO_H
35 #define FI_ERRNO_H
36 
37 #include <errno.h>
38 
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42 
43 /* FI directly mapped errno values */
44 
45 #define	FI_SUCCESS		0
46 
47 #define	FI_EPERM		EPERM		/* Operation not permitted */
48 #define	FI_ENOENT		ENOENT		/* No such file or directory */
49 //#define	FI_ESRCH		ESRCH		/* No such process */
50 #define	FI_EINTR		EINTR		/* Interrupted system call */
51 #define	FI_EIO		 	EIO		/* I/O error */
52 //#define	FI_ENXIO		ENXIO		/* No such device or address */
53 #define	FI_E2BIG		E2BIG		/* Argument list too long */
54 //#define	FI_ENOEXEC		ENOEXEC		/* Exec format error */
55 #define	FI_EBADF		EBADF		/* Bad file number */
56 //#define	FI_ECHILD		ECHILD		/* No child processes */
57 #define	FI_EAGAIN		EAGAIN		/* Try again */
58 #define	FI_ENOMEM		ENOMEM		/* Out of memory */
59 #define	FI_EACCES		EACCES		/* Permission denied */
60 #define	FI_EFAULT		EFAULT		/* Bad address */
61 //#define	FI_ENOTBLK		ENOTBLK		/* Block device required */
62 #define	FI_EBUSY		EBUSY		/* Device or resource busy */
63 //#define	FI_EEXIST		EEXIST		/* File exists */
64 //#define	FI_EXDEV		EXDEV		/* Cross-device link */
65 #define	FI_ENODEV		ENODEV		/* No such device */
66 //#define	FI_ENOTDIR		ENOTDIR		/* Not a directory */
67 //#define	FI_EISDIR		EISDIR		/* Is a directory */
68 #define	FI_EINVAL		EINVAL		/* Invalid argument */
69 //#define	FI_ENFILE		ENFILE		/* File table overflow */
70 #define	FI_EMFILE		EMFILE		/* Too many open files */
71 //#define	FI_ENOTTY		ENOTTY		/* Not a typewriter */
72 //#define	FI_ETXTBSY		ETXTBSY		/* Text file busy */
73 //#define	FI_EFBIG		EFBIG		/* File too large */
74 #define	FI_ENOSPC		ENOSPC		/* No space left on device */
75 //#define	FI_ESPIPE		ESPIPE		/* Illegal seek */
76 //#define	FI_EROFS		EROFS		/* Read-only file system */
77 //#define	FI_EMLINK		EMLINK		/* Too many links */
78 //#define	FI_EPIPE		EPIPE		/* Broken pipe */
79 //#define	FI_EDOM			EDOM		/* Math argument out of domain of func */
80 //#define	FI_ERANGE		ERANGE		/* Math result not representable */
81 //#define	FI_EDEADLK		EDEADLK		/* Resource deadlock would occur */
82 //#define	FI_ENAMETOOLONG		ENAMETOLONG	/* File name too long */
83 //#define	FI_ENOLCK		ENOLCK		/* No record locks available */
84 #define	FI_ENOSYS		ENOSYS		/* Function not implemented */
85 //#define	FI_ENOTEMPTY		ENOTEMPTY	/* Directory not empty */
86 //#define	FI_ELOOP		ELOOP		/* Too many symbolic links encountered */
87 #define	FI_EWOULDBLOCK		EWOULDBLOCK	/* Operation would block */
88 #define	FI_ENOMSG		ENOMSG		/* No message of desired type */
89 //#define	FI_EIDRM		EIDRM		/* Identifier removed */
90 //#define	FI_ECHRNG		ECHRNG		/* Channel number out of range */
91 //#define	FI_EL2NSYNC		EL2NSYCN	/* Level 2 not synchronized */
92 //#define	FI_EL3HLT		EL3HLT		/* Level 3 halted */
93 //#define	FI_EL3RST		EL3RST		/* Level 3 reset */
94 //#define	FI_ELNRNG		ELNRNG		/* Link number out of range */
95 //#define	FI_EUNATCH		EUNATCH		/* Protocol driver not attached */
96 //#define	FI_ENOCSI		ENOCSI		/* No CSI structure available */
97 //#define	FI_EL2HLT		EL2HLT		/* Level 2 halted */
98 //#define	FI_EBADE		EBADE		/* Invalid exchange */
99 //#define	FI_EBADR		EBADDR		/* Invalid request descriptor */
100 //#define	FI_EXFULL		EXFULL		/* Exchange full */
101 //#define	FI_ENOANO		ENOANO		/* No anode */
102 //#define	FI_EBADRQC		EBADRQC		/* Invalid request code */
103 //#define	FI_EBADSLT		EBADSLT		/* Invalid slot */
104 //#define	FI_EDEADLOCK		EDEADLOCK	/* Resource deadlock would occur */
105 //#define	FI_EBFONT		EBFONT		/* Bad font file format */
106 //#define	FI_ENOSTR		ENOSTR		/* Device not a stream */
107 #define	FI_ENODATA		ENODATA		/* No data available */
108 //#define	FI_ETIME		ETIME		/* Timer expired */
109 //#define	FI_ENOSR		ENOSR		/* Out of streams resources */
110 //#define	FI_ENONET		ENONET		/* Machine is not on the network */
111 //#define	FI_ENOPKG		ENOPKG		/* Package not installed */
112 //#define	FI_EREMOTE		EREMOTE		/* Object is remote */
113 //#define	FI_ENOLINK		ENOLINK		/* Link has been severed */
114 //#define	FI_EADV			EADV		/* Advertise error */
115 //#define	FI_ESRMNT		ESRMNT		/* Srmount error */
116 //#define	FI_ECOMM		ECOMM		/* Communication error on send */
117 //#define	FI_EPROTO		EPROTO		/* Protocol error */
118 //#define	FI_EMULTIHOP		EMULTIHOP	/* Multihop attempted */
119 //#define	FI_EDOTDOT		EDOTDOT		/* RFS specific error */
120 //#define	FI_EBADMSG		EBADMSG		/* Not a data message */
121 #define	FI_EOVERFLOW		EOVERFLOW	/* Value too large for defined data type */
122 //#define	FI_ENOTUNIQ		ENOTUNIQ	/* Name not unique on network */
123 //#define	FI_EBADFD		EBADFD		/* File descriptor in bad state */
124 //#define	FI_EREMCHG		EREMCHG		/* Remote address changed */
125 //#define	FI_ELIBACC		ELIBACC		/* Can not access a needed shared library */
126 //#define	FI_ELIBBAD		ELIBBAD		/* Accessing a corrupted shared library */
127 //#define	FI_ELIBSCN		ELIBSCN		/* .lib section in a.out corrupted */
128 //#define	FI_ELIBMAX		ELIBMAX		/* Attempting to link in too many shared libraries */
129 //#define	FI_ELIBEXEC		ELIBEXEC	/* Cannot exec a shared library directly */
130 //#define	FI_EILSEQ		EILSEQ		/* Illegal byte sequence */
131 //#define	FI_ERESTART		ERESTART	/* Interrupted system call should be restarted */
132 //#define	FI_ESTRPIPE		ESTRPIPE	/* Streams pipe error */
133 //#define	FI_EUSERS		EUSERS		/* Too many users */
134 //#define	FI_ENOTSOCK		ENOTSOCK	/* Socket operation on non-socket */
135 //#define	FI_EDESTADDRREQ		EDESTADDRREQ	/* Destination address required */
136 #define	FI_EMSGSIZE		EMSGSIZE	/* Message too long */
137 //#define	FI_EPROTOTYPE		EPROTOTYPE	/* Protocol wrong type for endpoint */
138 #define	FI_ENOPROTOOPT		ENOPROTOOPT	/* Protocol not available */
139 //#define	FI_EPROTONOSUPPORT	EPROTONOSUPPORT	/* Protocol not supported */
140 //#define	FI_ESOCKTNOSUPPORT	ESOCKTNOSUPPORT	/* Socket type not supported */
141 #define	FI_EOPNOTSUPP		EOPNOTSUPP	/* Operation not supported on transport endpoint */
142 //#define	FI_EPFNOSUPPORT		EPFNOSUPPORT	/* Protocol family not supported */
143 //#define	FI_EAFNOSUPPORT		EAFNOSUPPORT	/* Address family not supported by protocol */
144 #define	FI_EADDRINUSE		EADDRINUSE	/* Address already in use */
145 #define	FI_EADDRNOTAVAIL	EADDRNOTAVAIL	/* Cannot assign requested address */
146 #define	FI_ENETDOWN		ENETDOWN	/* Network is down */
147 #define	FI_ENETUNREACH		ENETUNREACH	/* Network is unreachable */
148 //#define	FI_ENETRESET		ENETRESET	/* Network dropped connection because of reset */
149 #define	FI_ECONNABORTED		ECONNABORTED	/* Software caused connection abort */
150 #define	FI_ECONNRESET		ECONNRESET	/* Connection reset by peer */
151 #define	FI_ENOBUFS		ENOBUFS		/* No buffer space available */
152 #define	FI_EISCONN		EISCONN		/* Transport endpoint is already connected */
153 #define	FI_ENOTCONN		ENOTCONN	/* Transport endpoint is not connected */
154 #define	FI_ESHUTDOWN		ESHUTDOWN	/* Cannot send after transport endpoint shutdown */
155 //#define	FI_ETOOMANYREFS		ETOOMANYREFS	/* Too many references: cannot splice */
156 #define	FI_ETIMEDOUT		ETIMEDOUT	/* Connection timed out */
157 #define	FI_ECONNREFUSED		ECONNREFUSED	/* Connection refused */
158 #define	FI_EHOSTDOWN		EHOSTDOWN	/* Host is down */
159 #define	FI_EHOSTUNREACH		EHOSTUNREACH	/* No route to host */
160 #define	FI_EALREADY		EALREADY	/* Operation already in progress */
161 #define	FI_EINPROGRESS		EINPROGRESS	/* Operation now in progress */
162 //#define	FI_ESTALE		ESTALE		/* Stale NFS file handle */
163 //#define	FI_EUCLEAN		EUNCLEAN	/* Structure needs cleaning */
164 //#define	FI_ENOTNAM		ENOTNAM		/* Not a XENIX named type file */
165 //#define	FI_ENAVAIL		ENAVAIL		/* No XENIX semaphores available */
166 //#define	FI_EISNAM		EISNAM		/* Is a named type file */
167 #define	FI_EREMOTEIO		EREMOTEIO	/* Remote I/O error */
168 //#define	FI_EDQUOT		EDQUOT		/* Quota exceeded */
169 //#define	FI_ENOMEDIUM		ENOMEDIUM	/* No medium found */
170 //#define	FI_EMEDIUMTYPE		EMEDIUMTYPE	/* Wrong medium type */
171 #define	FI_ECANCELED		ECANCELED	/* Operation Canceled */
172 
173 //#define	FI_EKEYEXPIRED		EKEYEXPIRED	/* Key has expired */
174 //#define	FI_EKEYREVOKED		EKEYREVOKED	/* Key has been revoked */
175 #define	FI_EKEYREJECTED		EKEYREJECTED	/* Key was rejected by service */
176 //#define	FI_EOWNERDEAD		EOWNERDEAD	/* Owner died */
177 //#define	FI_ENOTRECOVERABLE	ENOTRECOVERABLE	/* State not recoverable */
178 
179 /* FI specific return values: >= 256 */
180 #define FI_ERRNO_OFFSET	256
181 
182 enum {
183 	FI_EOTHER        = FI_ERRNO_OFFSET, /* Unspecified error */
184 	FI_ETOOSMALL     = 257, /* Provided buffer is too small */
185 	FI_EOPBADSTATE   = 258, /* Operation not permitted in current state */
186 	FI_EAVAIL        = 259, /* Error available */
187 	FI_EBADFLAGS     = 260, /* Flags not supported */
188 	FI_ENOEQ         = 261, /* Missing or unavailable event queue */
189 	FI_EDOMAIN       = 262, /* Invalid resource domain */
190 	FI_ENOCQ         = 263, /* Missing or unavailable completion queue */
191 	FI_ECRC          = 264, /* CRC error */
192 	FI_ETRUNC        = 265, /* Truncation error */
193 	FI_ENOKEY        = 266, /* Required key not available */
194 	FI_ENOAV	 = 267, /* Missing or unavailable address vector */
195 	FI_EOVERRUN	 = 268, /* Queue has been overrun */
196 	FI_ERRNO_MAX
197 };
198 
199 const char *fi_strerror(int errnum);
200 
201 #ifdef __cplusplus
202 }
203 #endif
204 
205 #endif /* FI_ERRNO_H */
206