fehQlibs 26
Qlibs
Loading...
Searching...
No Matches
errstr.c
Go to the documentation of this file.
1#include "error.h"
2
10#define X(e,s) if (code == e) return s;
11
12extern char *error_str(int);
13
14char *errstr(int code)
15{
16 X(0,"") // NOERROR
17 X(error_intr,"interrupted system call") // EINTR
18 X(EINTR, "interrupted system call")
19 X(error_nomem,"out of memory") // ENOMEM
20 X(ENOMEM, "out of memory")
21 X(error_noent,"file does not exist") // ENOENT
22 X(ENOENT, "file does not exist")
23 X(error_txtbsy,"text busy") // ETXTBSY
24 X(ETXTBSY, "text busy")
25 X(error_io,"input/output error") // EIO
26 X(EIO, "input/output error")
27 X(error_exist,"file already exists") // EEXISTS
28 X(EEXIST, "file already exists")
29 X(error_timeout,"timed out") // ETIMEDOUT
30 X(ETIMEDOUT, "timed out")
31 X(error_inprogress,"operation in progress") // EINPROGRESS
32 X(EINPROGRESS, "operation in progress")
33 X(error_again,"temporary failure") // EAGAIN
34 X(EAGAIN, "temporary failure")
35 X(error_wouldblock,"input/output would block") // EWOULDBLOCK (intern EAGAIN)
36 X(EWOULDBLOCK, "input/output would block")
37 X(error_pipe,"broken pipe") // EPIPE
38 X(EPIPE, "broken pipe")
39 X(error_perm,"permission denied") // EPERM
40 X(EPERM, "permission denied")
41 X(error_acces,"access denied") // EACCES
42 X(EACCES, "access denied")
43
44 X(ESRCH, "no such process")
45
46// X(error_nodevice,"device not configured") // ENXIO
47 X(ENXIO, "device not configured")
48
49 X(E2BIG, "argument list too long")
50 X(ENOEXEC, "exec format error")
51 X(EBADF, "file descriptor not open")
52 X(ECHILD, "no child processes")
53 X(EDEADLK, "operation would cause deadlock")
54 X(EFAULT, "bad address")
55 X(ENOTBLK, "not a block device")
56 X(EBUSY, "device busy")
57 X(EXDEV, "cross-device link")
58 X(ENODEV, "device does not support operation")
59// X(error_notdir,"not a directory") // ENOTDIR
60 X(ENOTDIR, "not a directory")
61 X(error_isdir,"is a directory") // EISDIR
62 X(EISDIR, "is a directory")
63 X(EINVAL, "invalid argument")
64 X(ENFILE, "system cannot open more files")
65 X(EMFILE, "process cannot open more files")
66 X(ENOTTY, "not a tty")
67 X(EFBIG, "file too big")
68 X(ENOSPC, "out of disk space")
69 X(ESPIPE, "unseekable descriptor")
70// X(error_rofs,"read-only file system") // EROFS
71 X(EROFS, "read-only file system")
72 X(EMLINK, "too many links")
73 X(EDOM, "input out of range")
74 X(ERANGE, "output out of range")
75 X(EALREADY, "operation already in progress")
76 X(ENOTSOCK, "not a socket")
77 X(EDESTADDRREQ, "destination address required")
78 X(EMSGSIZE, "message too long")
79 X(EPROTOTYPE, "incorrect protocol type")
80 X(ENOPROTOOPT, "protocol not available")
81 X(EPROTONOSUPPORT, "protocol not supported")
82 X(ESOCKTNOSUPPORT, "socket type not supported")
83 X(EOPNOTSUPP, "operation not supported")
84 X(EPFNOSUPPORT, "protocol family not supported")
85 X(EAFNOSUPPORT, "address family not supported")
86 X(EADDRINUSE, "address already used")
87 X(EADDRNOTAVAIL, "address not available")
88 X(ENETDOWN, "network down")
89 X(ENETUNREACH, "network unreachable")
90 X(ENETRESET, "network reset")
91 X(ECONNABORTED, "connection aborted")
92 X(error_connreset, "connection reset") // ECONNRESET
93 X(ECONNRESET, "connection reset")
94 X(ENOBUFS, "out of buffer space")
95 X(EISCONN, "already connected")
96 X(ENOTCONN, "not connected")
97 X(ESHUTDOWN, "socket shut down")
98 X(ETOOMANYREFS, "too many references")
99 X(error_connrefused,"connection refused") // ECONNREFUSED
100 X(ECONNREFUSED, "connection refused")
101 X(ELOOP, "symbolic link loop")
102 X(ENAMETOOLONG, "file name too long")
103 X(EHOSTDOWN, "host down")
104 X(EHOSTUNREACH, "host unreachable")
105 X(ENOTEMPTY, "directory not empty")
106 X(EUSERS, "too many users")
107 X(EDQUOT, "disk quota exceeded")
108 X(ESTALE, "stale NFS file handle")
109
110 /* BSD only (all BSD's, NOT on Linux) */
111// X(EPROCLIM, "too many processes") // -L +FB +OB +NB
112// X(EBADRPC, "RPC structure is bad") // -L +FB +OB +NB
113
114// X(ERPCMISMATCH, "RPC version mismatch") // -L +FB +OB +NB
115// X(EPROGUNAVAIL, "RPC program unavailable") // -L +FB +OB +NB
116// X(EPROGMISMATCH, "program version mismatch") // -L +FB +OB +NB
117// X(EPROCUNAVAIL, "bad procedure for program") // -L +FB +OB +NB
118// X(EFTYPE, "bad file type") // -L +FB +OB +NB
119
120 X(ENOLCK, "no locks available")
121 X(ENOSYS, "system call not available")
122 X(ENOMSG, "no message of desired type")
123 X(EIDRM, "identifier removed")
124
125// X(ERREMOTE, "object not local") // -L -FB -OB -NB
126 X(EREMOTE, "object not local") // Linux: "Object is remote"
127// X(EREMOTE, "too many levels of remote in path")
128
129 /* Linux only */
130// X(ENONET, "machine not on network") // +L -FB -OB -NB
131// X(EADV, "advertise error") // +L -FB -OB -NB
132// X(ESRMNT, "srmount error") // +L -FB -OB -NB
133// X(ECOMM, "communication error") // +L -FB -OB -NB
134// X(EREMCHG, "remote address changed") // +L -FB -OB -NB
135
136 X(error_proto,"protocol error") // EPROTO
137 /* EPROTO: see 'error.h' for OpenBSD compat */
138 X(EPROTO, "protocol error") // +L +FB -OB +NB
139
140 /* Linux and NetBSD */
141// X(ENOSTR, "not a stream device") // +L -FB -OB +NB
142// X(ETIME, "timer expired") // +L -FB -OB +NB
143// X(ENOSR, "out of stream resources") // +L -FB -OB +NB
144
145 /* FreeBSD and NetBSD */
146// X(EAUTH, "authentication error") // -L +FB -OB +NB
147// X(ENEEDAUTH, "not authenticated") // -L +FB -OB +NB
148
149 /* NOT on OpenBSD */
150// X(EBADMSG, "bad message type") // +L +FB -OB +NB
151// X(ENOLINK, "link severed") // +L +FB -OB +NB
152// X(EMULTIHOP, "multihop attempted") // +L +FB -OB +NB
153
154 /* Application/DJB specific */
155 X(EHARD, " ")
156 X(ESOFT, " ")
157 X(USAGE, "usage error") // qmail; explicit
158 X(SYNTAX, "syntax error") // djbdns, qmail; explicit
159 X(DROP, "connection dropped") // ucspi-tcp
160 X(FATAL, "unable to continue") // all
161
162 return "unknown error"; /* worst case */
163}
char * errstr(int code)
Definition: errstr.c:14
#define X(e, s)
Definition: errstr.c:10
#define EAFNOSUPPORT
Definition: socket_tcp.c:12
#define error_timeout
Definition: error.h:27
#define error_wouldblock
Definition: error.h:29
#define error_txtbsy
Definition: error.h:24
#define FATAL
Definition: error.h:54
#define error_inprogress
Definition: error.h:28
#define error_connreset
Definition: error.h:40
#define error_proto
Definition: error.h:35
#define error_exist
Definition: error.h:26
#define USAGE
Definition: error.h:51
#define error_io
Definition: error.h:25
#define EPROTO
Definition: error.h:7
#define ESOFT
Definition: error.h:49
#define error_isdir
Definition: error.h:36
#define error_nomem
Definition: error.h:22
#define error_acces
Definition: error.h:33
#define EHARD
Definition: error.h:50
#define error_noent
Definition: error.h:23
#define error_intr
Definition: error.h:21
#define error_str(i)
Definition: error.h:10
#define SYNTAX
Definition: error.h:52
#define error_pipe
Definition: error.h:31
#define error_connrefused
Definition: error.h:37
#define DROP
Definition: error.h:53
#define error_perm
Definition: error.h:32
#define error_again
Definition: error.h:30