FreeNOS
errno.c
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2009 Niek Linnenbank
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #include <Macros.h>
19 #include "errno.h"
20 
21 int errno USED = 0;
22 
23 char * error_map[] USED =
24 {
25  [-ESUCCESS] = "Success",
26  [-E2BIG] = "Argument list too long",
27  [-EACCES] = "Permission denied",
28  [-EADDRINUSE] = "Address in use",
29  [-EADDRNOTAVAIL] = "Address not available",
30  [-EAFNOSUPPORT] = "Address family not supported",
31  [-EAGAIN] = "Resource temporary unavailable",
32  [-EALREADY] = "Connection already in progress",
33  [-EBADF] = "Bad file descriptor",
34  [-EBADMSG] = "Bad message",
35  [-EBUSY] = "Device or resource busy",
36  [-ECANCELED] = "Operation canceled",
37  [-ECHILD] = "No child processes",
38  [-ECONNABORTED] = "Connection aborted",
39  [-ECONNREFUSED] = "Connection refused",
40  [-ECONNRESET] = "Connection reset",
41  [-EDEADLK] = "Resource deadlock would occur",
42  [-EDESTADDRREQ] = "Destination address required",
43  [-EDOM] = "Mathematics argument out of domain of function",
44  [-EDQUOT] = "Reserved",
45  [-EEXIST] = "File already exists",
46  [-EFAULT] = "Bad address",
47  [-EFBIG] = "File too large",
48  [-EHOSTUNREACH] = "Host is unreachable",
49  [-EIDRM] = "Identifier removed",
50  [-EILSEQ] = "Illegal byte sequence",
51  [-EINPROGRESS] = "Operation in progress",
52  [-EINTR] = "Interrupted function",
53  [-EINVAL] = "Invalid argument",
54  [-EIO] = "I/O error",
55  [-EISCONN] = "Socket is connected",
56  [-EISDIR] = "Is a directory",
57  [-ELOOP] = "Too many levels of symbolic links",
58  [-EMFILE] = "File descriptor value too large",
59  [-EMLINK] = "Too many links",
60  [-EMSGSIZE] = "Message too large",
61  [-EMULTIHOP] = "Reserved",
62  [-ENAMETOOLONG] = "Filename too long",
63  [-ENETDOWN] = "Network is down",
64  [-ENETRESET] = "Connection aborted by network",
65  [-ENETUNREACH] = "Network unreachable",
66  [-ENFILE] = "Too many files open in system",
67  [-ENOBUFS] = "No buffer space available",
68  [-ENODATA] = "No message is available on the STREAM head read queue",
69  [-ENODEV] = "No such device",
70  [-ENOENT] = "No such file or directory",
71  [-ENOEXEC] = "Executable file format error",
72  [-ENOLCK] = "No locks available",
73  [-ENOLINK] = "Reserved",
74  [-ENOMEM] = "Not enough memory space",
75  [-ENOMSG] = "No message of the desired type",
76  [-ENOPROTOOPT] = "Protocol not available",
77  [-ENOSPC] = "No space left on device",
78  [-ENOSR] = "No STREAM resources",
79  [-ENOSTR] = "Not a STREAM",
80  [-ENOSYS] = "Function not supported",
81  [-ENOTCONN] = "The socket is not connected",
82  [-ENOTDIR] = "Not a directory",
83  [-ENOTEMPTY] = "Directory not empty",
84  [-ENOTRECOVERABLE] = "State not recoverable",
85  [-ENOTSOCK] = "Not a socket",
86  [-ENOTSUP] = "Operation not supported",
87  [-ENOTTY] = "Inappropriate I/O control operation",
88  [-ENXIO] = "No such device or address",
89  [-EOPNOTSUPP] = "Operation not supported on socket",
90  [-EOVERFLOW] = "Value too large to be stored in data type",
91  [-EOWNERDEAD] = "Previous owner died",
92  [-EPERM] = "Operation not permitted",
93  [-EPIPE] = "Broken pipe",
94  [-EPROTO] = "Protocol error",
95  [-EPROTONOSUPPORT] = "Protocol not supported",
96  [-EPROTOTYPE] = "Protocol wrong type for socket",
97  [-ERANGE] = "Result too large",
98  [-EROFS] = "Read-only file system",
99  [-ESPIPE] = "Invalid seek",
100  [-ESRCH] = "No such process",
101  [-ESTALE] = "Reserved",
102  [-ETIME] = "Stream ioctl() timeout",
103  [-ETIMEDOUT] = "Connection timed out",
104  [-ETXTBSY] = "Text file busy",
105  [-EWOULDBLOCK] = "Operation would block",
106  [-EXDEV] = "Cross-device link"
107 };
EOVERFLOW
#define EOVERFLOW
Value too large to be stored in data type.
Definition: errno.h:238
EAGAIN
#define EAGAIN
Resource unavailable, try again (may be the same value as [EWOULDBLOCK]).
Definition: errno.h:61
EPIPE
#define EPIPE
Broken pipe.
Definition: errno.h:247
ENOTCONN
#define ENOTCONN
The socket is not connected.
Definition: errno.h:211
Macros.h
ETIMEDOUT
#define ETIMEDOUT
Connection timed out.
Definition: errno.h:277
ENETDOWN
#define ENETDOWN
Network is down.
Definition: errno.h:157
EILSEQ
#define EILSEQ
Illegal byte sequence.
Definition: errno.h:118
errno
C int errno
The lvalue errno is used by many functions to return error values.
ENOSR
#define ENOSR
No STREAM resources.
Definition: errno.h:202
EISDIR
#define EISDIR
Is a directory.
Definition: errno.h:136
EDESTADDRREQ
#define EDESTADDRREQ
Destination address required.
Definition: errno.h:94
ENFILE
#define ENFILE
Too many files open in system.
Definition: errno.h:166
EINTR
#define EINTR
Interrupted function.
Definition: errno.h:124
EBUSY
#define EBUSY
Device or resource busy.
Definition: errno.h:73
ECONNABORTED
#define ECONNABORTED
Connection aborted.
Definition: errno.h:82
EOWNERDEAD
#define EOWNERDEAD
Previous owner died.
Definition: errno.h:241
ENOSPC
#define ENOSPC
No space left on device.
Definition: errno.h:199
ECHILD
#define ECHILD
No child processes.
Definition: errno.h:79
EINVAL
#define EINVAL
Invalid argument.
Definition: errno.h:127
ELOOP
#define ELOOP
Too many levels of symbolic links.
Definition: errno.h:139
ENAMETOOLONG
#define ENAMETOOLONG
Filename too long.
Definition: errno.h:154
ENOTTY
#define ENOTTY
Inappropriate I/O control operation.
Definition: errno.h:229
ENETRESET
#define ENETRESET
Connection aborted by network.
Definition: errno.h:160
ESUCCESS
#define ESUCCESS
Reports a success operation.
Definition: errno.h:43
EMULTIHOP
#define EMULTIHOP
Reserved.
Definition: errno.h:151
EBADF
#define EBADF
Bad file descriptor.
Definition: errno.h:67
ECONNREFUSED
#define ECONNREFUSED
Connection refused.
Definition: errno.h:85
ENOBUFS
#define ENOBUFS
No buffer space available.
Definition: errno.h:169
ETIME
#define ETIME
Stream ioctl() timeout.
Definition: errno.h:274
EACCES
#define EACCES
Permission denied.
Definition: errno.h:49
EPROTONOSUPPORT
#define EPROTONOSUPPORT
Protocol not supported.
Definition: errno.h:253
ENOMEM
#define ENOMEM
Not enough space.
Definition: errno.h:190
ENODATA
#define ENODATA
No message is available on the STREAM head read queue.
Definition: errno.h:172
ENOEXEC
#define ENOEXEC
Executable file format error.
Definition: errno.h:181
EMLINK
#define EMLINK
Too many links.
Definition: errno.h:145
ECANCELED
#define ECANCELED
Operation canceled.
Definition: errno.h:76
EROFS
#define EROFS
Read-only file system.
Definition: errno.h:262
ETXTBSY
#define ETXTBSY
Text file busy.
Definition: errno.h:280
ENOTSOCK
#define ENOTSOCK
Not a socket.
Definition: errno.h:223
USED
int errno USED
Definition: errno.c:21
EISCONN
#define EISCONN
Socket is connected.
Definition: errno.h:133
EPERM
#define EPERM
Operation not permitted.
Definition: errno.h:244
ENOTSUP
#define ENOTSUP
Not supported (may be the same value as [EOPNOTSUPP]).
Definition: errno.h:226
ENOTRECOVERABLE
#define ENOTRECOVERABLE
State not recoverable.
Definition: errno.h:220
ENOLINK
#define ENOLINK
Reserved.
Definition: errno.h:187
EHOSTUNREACH
#define EHOSTUNREACH
Host is unreachable.
Definition: errno.h:112
error_map
C char * error_map[]
Contains a array of character strings, representing errno values.
Definition: errno.c:23
EDQUOT
#define EDQUOT
Reserved.
Definition: errno.h:100
ENOSYS
#define ENOSYS
Function not supported.
Definition: errno.h:208
EALREADY
#define EALREADY
Connection already in progress.
Definition: errno.h:64
EPROTOTYPE
#define EPROTOTYPE
Protocol wrong type for socket.
Definition: errno.h:256
ENOMSG
#define ENOMSG
No message of the desired type.
Definition: errno.h:193
ESTALE
#define ESTALE
Reserved.
Definition: errno.h:271
EIO
#define EIO
I/O error.
Definition: errno.h:130
ENODEV
#define ENODEV
No such device.
Definition: errno.h:175
EFAULT
#define EFAULT
Bad address.
Definition: errno.h:106
ESRCH
#define ESRCH
No such process.
Definition: errno.h:268
EMSGSIZE
#define EMSGSIZE
Message too large.
Definition: errno.h:148
ENOTEMPTY
#define ENOTEMPTY
Directory not empty.
Definition: errno.h:217
EWOULDBLOCK
#define EWOULDBLOCK
Operation would block (may be the same value as [EAGAIN]).
Definition: errno.h:283
EMFILE
#define EMFILE
File descriptor value too large.
Definition: errno.h:142
ENXIO
#define ENXIO
No such device or address.
Definition: errno.h:232
EAFNOSUPPORT
#define EAFNOSUPPORT
Address family not supported.
Definition: errno.h:58
EADDRINUSE
#define EADDRINUSE
Address in use.
Definition: errno.h:52
EIDRM
#define EIDRM
Identifier removed.
Definition: errno.h:115
EXDEV
#define EXDEV
Cross-device link.
Definition: errno.h:286
ENOENT
#define ENOENT
No such file or directory.
Definition: errno.h:178
EADDRNOTAVAIL
#define EADDRNOTAVAIL
Address not available.
Definition: errno.h:55
EBADMSG
#define EBADMSG
Bad message.
Definition: errno.h:70
ENETUNREACH
#define ENETUNREACH
Network unreachable.
Definition: errno.h:163
EOPNOTSUPP
#define EOPNOTSUPP
Operation not supported on socket (may be the same value as [ENOTSUP]).
Definition: errno.h:235
EPROTO
#define EPROTO
Protocol error.
Definition: errno.h:250
ENOLCK
#define ENOLCK
No locks available.
Definition: errno.h:184
EDOM
#define EDOM
Mathematics argument out of domain of function.
Definition: errno.h:97
EDEADLK
#define EDEADLK
Resource deadlock would occur.
Definition: errno.h:91
ERANGE
#define ERANGE
Result too large.
Definition: errno.h:259
ENOSTR
#define ENOSTR
Not a STREAM.
Definition: errno.h:205
ENOPROTOOPT
#define ENOPROTOOPT
Protocol not available.
Definition: errno.h:196
ENOTDIR
#define ENOTDIR
Not a directory.
Definition: errno.h:214
ECONNRESET
#define ECONNRESET
Connection reset.
Definition: errno.h:88
EINPROGRESS
#define EINPROGRESS
Operation in progress.
Definition: errno.h:121
E2BIG
#define E2BIG
Argument list too long.
Definition: errno.h:46
EFBIG
#define EFBIG
File too large.
Definition: errno.h:109
errno.h
ESPIPE
#define ESPIPE
Invalid seek.
Definition: errno.h:265
EEXIST
#define EEXIST
File exists.
Definition: errno.h:103