]>
cvs.zerfleddert.de Git - micropolis/blob - src/tcl/compat/strerror.c
4 * Source code for the "strerror" library routine.
6 * Copyright 1988-1991 Regents of the University of California
7 * Permission to use, copy, modify, and distribute this
8 * software and its documentation for any purpose and without
9 * fee is hereby granted, provided that the above copyright
10 * notice appears in all copies. The University of California
11 * makes no representations about the suitability of this
12 * software for any purpose. It is provided "as is" without
13 * express or implied warranty.
17 static char rcsid
[] = "$Header: /user6/ouster/tcl/compat/RCS/strerror.c,v 1.2 91/12/16 09:26:48 ouster Exp $ SPRITE (Berkeley)";
24 *----------------------------------------------------------------------
28 * Map an integer error number into a printable string.
31 * The return value is a pointer to a string describing
32 * error. The first character of string isn't capitalized.
35 * Each call to this procedure may overwrite the value returned
36 * by the previous call.
38 *----------------------------------------------------------------------
43 int error
; /* Integer identifying error (must be
44 * one of the officially-defined Sprite
45 * errors, as defined in errno.h). */
50 if ((error
<= sys_nerr
) && (error
> 0)) {
51 return sys_errlist
[error
];
56 case E2BIG
: return "argument list too long";
59 case EACCES
: return "permission denied";
62 case EADDRINUSE
: return "address already in use";
65 case EADDRNOTAVAIL
: return "can't assign requested address";
68 case EADV
: return "advertise error";
71 case EAFNOSUPPORT
: return "address family not supported by protocol family";
74 case EAGAIN
: return "no more processes";
77 case EALIGN
: return "EALIGN";
80 case EALREADY
: return "operation already in progress";
83 case EBADE
: return "bad exchange descriptor";
86 case EBADF
: return "bad file number";
89 case EBADFD
: return "file descriptor in bad state";
92 case EBADMSG
: return "not a data message";
95 case EBADR
: return "bad request descriptor";
98 case EBADRPC
: return "RPC structure is bad";
101 case EBADRQC
: return "bad request code";
104 case EBADSLT
: return "invalid slot";
107 case EBFONT
: return "bad font file format";
110 case EBUSY
: return "mount device busy";
113 case ECHILD
: return "no children";
116 case ECHRNG
: return "channel number out of range";
119 case ECOMM
: return "communication error on send";
122 case ECONNABORTED
: return "software caused connection abort";
125 case ECONNREFUSED
: return "connection refused";
128 case ECONNRESET
: return "connection reset by peer";
130 #if defined(EDEADLK) && (!defined(EWOULDBLOCK) || (EDEADLK != EWOULDBLOCK))
131 case EDEADLK
: return "resource deadlock avoided";
134 case EDEADLOCK
: return "resource deadlock avoided";
137 case EDESTADDRREQ
: return "destination address required";
140 case EDIRTY
: return "mounting a dirty fs w/o force";
143 case EDOM
: return "math argument out of range";
146 case EDOTDOT
: return "cross mount point";
149 case EDQUOT
: return "disk quota exceeded";
152 case EDUPPKG
: return "duplicate package name";
155 case EEXIST
: return "file already exists";
158 case EFAULT
: return "bad address in system call argument";
161 case EFBIG
: return "file too large";
164 case EHOSTDOWN
: return "host is down";
167 case EHOSTUNREACH
: return "host is unreachable";
170 case EIDRM
: return "identifier removed";
173 case EINIT
: return "initialization error";
176 case EINPROGRESS
: return "operation now in progress";
179 case EINTR
: return "interrupted system call";
182 case EINVAL
: return "invalid argument";
185 case EIO
: return "I/O error";
188 case EISCONN
: return "socket is already connected";
191 case EISDIR
: return "illegal operation on a directory";
194 case EISNAM
: return "is a name file";
197 case ELBIN
: return "ELBIN";
200 case EL2HLT
: return "level 2 halted";
203 case EL2NSYNC
: return "level 2 not synchronized";
206 case EL3HLT
: return "level 3 halted";
209 case EL3RST
: return "level 3 reset";
212 case ELIBACC
: return "can not access a needed shared library";
215 case ELIBBAD
: return "accessing a corrupted shared library";
218 case ELIBEXEC
: return "can not exec a shared library directly";
222 "attempting to link in more shared libraries than system limit";
225 case ELIBSCN
: return ".lib section in a.out corrupted";
228 case ELNRNG
: return "link number out of range";
231 case ELOOP
: return "too many levels of symbolic links";
234 case EMFILE
: return "too many open files";
237 case EMLINK
: return "too many links";
240 case EMSGSIZE
: return "message too long";
243 case EMULTIHOP
: return "multihop attempted";
246 case ENAMETOOLONG
: return "file name too long";
249 case ENAVAIL
: return "not available";
252 case ENET
: return "ENET";
255 case ENETDOWN
: return "network is down";
258 case ENETRESET
: return "network dropped connection on reset";
261 case ENETUNREACH
: return "network is unreachable";
264 case ENFILE
: return "file table overflow";
267 case ENOANO
: return "anode table overflow";
269 #if defined(ENOBUFS) && (!defined(ENOSR) || (ENOBUFS != ENOSR))
270 case ENOBUFS
: return "no buffer space available";
273 case ENOCSI
: return "no CSI structure available";
276 case ENODATA
: return "no data available";
279 case ENODEV
: return "no such device";
282 case ENOENT
: return "no such file or directory";
285 case ENOEXEC
: return "exec format error";
288 case ENOLCK
: return "no locks available";
291 case ENOLINK
: return "link has be severed";
294 case ENOMEM
: return "not enough memory";
297 case ENOMSG
: return "no message of desired type";
300 case ENONET
: return "machine is not on the network";
303 case ENOPKG
: return "package not installed";
306 case ENOPROTOOPT
: return "bad proocol option";
309 case ENOSPC
: return "no space left on device";
312 case ENOSR
: return "out of stream resources";
315 case ENOSTR
: return "not a stream device";
318 case ENOSYM
: return "unresolved symbol name";
321 case ENOSYS
: return "function not implemented";
324 case ENOTBLK
: return "block device required";
327 case ENOTCONN
: return "socket is not connected";
330 case ENOTDIR
: return "not a directory";
333 case ENOTEMPTY
: return "directory not empty";
336 case ENOTNAM
: return "not a name file";
339 case ENOTSOCK
: return "socket operation on non-socket";
342 case ENOTTY
: return "inappropriate device for ioctl";
345 case ENOTUNIQ
: return "name not unique on network";
348 case ENXIO
: return "no such device or address";
351 case EOPNOTSUPP
: return "operation not supported on socket";
354 case EPERM
: return "not owner";
357 case EPFNOSUPPORT
: return "protocol family not supported";
360 case EPIPE
: return "broken pipe";
363 case EPROCLIM
: return "too many processes";
366 case EPROCUNAVAIL
: return "bad procedure for program";
369 case EPROGMISMATCH
: return "program version wrong";
372 case EPROGUNAVAIL
: return "RPC program not available";
375 case EPROTO
: return "protocol error";
377 #ifdef EPROTONOSUPPORT
378 case EPROTONOSUPPORT
: return "protocol not suppored";
381 case EPROTOTYPE
: return "protocol wrong type for socket";
384 case ERANGE
: return "math result unrepresentable";
386 #if defined(EREFUSED) && (!defined(ECONNREFUSED) || (EREFUSED != ECONNREFUSED))
387 case EREFUSED
: return "EREFUSED";
390 case EREMCHG
: return "remote address changed";
393 case EREMDEV
: return "remote device";
396 case EREMOTE
: return "pathname hit remote file system";
399 case EREMOTEIO
: return "remote i/o error";
401 #ifdef EREMOTERELEASE
402 case EREMOTERELEASE
: return "EREMOTERELEASE";
405 case EROFS
: return "read-only file system";
408 case ERPCMISMATCH
: return "RPC version is wrong";
411 case ERREMOTE
: return "object is remote";
414 case ESHUTDOWN
: return "can't send afer socket shutdown";
416 #ifdef ESOCKTNOSUPPORT
417 case ESOCKTNOSUPPORT
: return "socket type not supported";
420 case ESPIPE
: return "invalid seek";
423 case ESRCH
: return "no such process";
426 case ESRMNT
: return "srmount error";
429 case ESTALE
: return "stale remote file handle";
432 case ESUCCESS
: return "Error 0";
435 case ETIME
: return "timer expired";
438 case ETIMEDOUT
: return "connection timed out";
441 case ETOOMANYREFS
: return "too many references: can't splice";
444 case ETXTBSY
: return "text file or pseudo-device busy";
447 case EUCLEAN
: return "structure needs cleaning";
450 case EUNATCH
: return "protocol driver not attached";
453 case EUSERS
: return "too many users";
456 case EVERSION
: return "version mismatch";
458 #if defined(EWOULDBLOCK) && (!defined(EAGAIN) || (EWOULDBLOCK != EAGAIN))
459 case EWOULDBLOCK
: return "operation would block";
462 case EXDEV
: return "cross-domain link";
465 case EXFULL
: return "message tables full";
468 #endif /* ! TCL_SYS_ERRLIST */
469 sprintf(msg
, "unknown error (%d)", error
);