/[dtapublic]/projs/dtats/trunk/shared_source/c_tcl_base_7_5_w_mods/tclposixstr.c
ViewVC logotype

Contents of /projs/dtats/trunk/shared_source/c_tcl_base_7_5_w_mods/tclposixstr.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 98 - (show annotations) (download)
Sun Dec 18 00:57:31 2016 UTC (7 years, 9 months ago) by dashley
File MIME type: text/plain
File size: 27744 byte(s)
Reorganization.
1 /* $Header$ */
2 /*
3 * tclPosixStr.c --
4 *
5 * This file contains procedures that generate strings
6 * corresponding to various POSIX-related codes, such
7 * as errno and signals.
8 *
9 * Copyright (c) 1991-1994 The Regents of the University of California.
10 * Copyright (c) 1994-1996 Sun Microsystems, Inc.
11 *
12 * See the file "license.terms" for information on usage and redistribution
13 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
14 *
15 * RCS: @(#) $Id: tclposixstr.c,v 1.1.1.1 2001/06/13 04:45:10 dtashley Exp $
16 */
17
18 #include "tclInt.h"
19 #include "tclPort.h"
20
21 /*
22 *----------------------------------------------------------------------
23 *
24 * Tcl_ErrnoId --
25 *
26 * Return a textual identifier for the current errno value.
27 *
28 * Results:
29 * This procedure returns a machine-readable textual identifier
30 * that corresponds to the current errno value (e.g. "EPERM").
31 * The identifier is the same as the #define name in errno.h.
32 *
33 * Side effects:
34 * None.
35 *
36 *----------------------------------------------------------------------
37 */
38
39 char *
40 Tcl_ErrnoId()
41 {
42 switch (errno) {
43 #ifdef E2BIG
44 case E2BIG: return "E2BIG";
45 #endif
46 #ifdef EACCES
47 case EACCES: return "EACCES";
48 #endif
49 #ifdef EADDRINUSE
50 case EADDRINUSE: return "EADDRINUSE";
51 #endif
52 #ifdef EADDRNOTAVAIL
53 case EADDRNOTAVAIL: return "EADDRNOTAVAIL";
54 #endif
55 #ifdef EADV
56 case EADV: return "EADV";
57 #endif
58 #ifdef EAFNOSUPPORT
59 case EAFNOSUPPORT: return "EAFNOSUPPORT";
60 #endif
61 #ifdef EAGAIN
62 case EAGAIN: return "EAGAIN";
63 #endif
64 #ifdef EALIGN
65 case EALIGN: return "EALIGN";
66 #endif
67 #if defined(EALREADY) && (!defined(EBUSY) || (EALREADY != EBUSY ))
68 case EALREADY: return "EALREADY";
69 #endif
70 #ifdef EBADE
71 case EBADE: return "EBADE";
72 #endif
73 #ifdef EBADF
74 case EBADF: return "EBADF";
75 #endif
76 #ifdef EBADFD
77 case EBADFD: return "EBADFD";
78 #endif
79 #ifdef EBADMSG
80 case EBADMSG: return "EBADMSG";
81 #endif
82 #ifdef EBADR
83 case EBADR: return "EBADR";
84 #endif
85 #ifdef EBADRPC
86 case EBADRPC: return "EBADRPC";
87 #endif
88 #ifdef EBADRQC
89 case EBADRQC: return "EBADRQC";
90 #endif
91 #ifdef EBADSLT
92 case EBADSLT: return "EBADSLT";
93 #endif
94 #ifdef EBFONT
95 case EBFONT: return "EBFONT";
96 #endif
97 #ifdef EBUSY
98 case EBUSY: return "EBUSY";
99 #endif
100 #ifdef ECHILD
101 case ECHILD: return "ECHILD";
102 #endif
103 #ifdef ECHRNG
104 case ECHRNG: return "ECHRNG";
105 #endif
106 #ifdef ECOMM
107 case ECOMM: return "ECOMM";
108 #endif
109 #ifdef ECONNABORTED
110 case ECONNABORTED: return "ECONNABORTED";
111 #endif
112 #ifdef ECONNREFUSED
113 case ECONNREFUSED: return "ECONNREFUSED";
114 #endif
115 #ifdef ECONNRESET
116 case ECONNRESET: return "ECONNRESET";
117 #endif
118 #if defined(EDEADLK) && (!defined(EWOULDBLOCK) || (EDEADLK != EWOULDBLOCK))
119 case EDEADLK: return "EDEADLK";
120 #endif
121 #if defined(EDEADLOCK) && (!defined(EDEADLK) || (EDEADLOCK != EDEADLK))
122 case EDEADLOCK: return "EDEADLOCK";
123 #endif
124 #ifdef EDESTADDRREQ
125 case EDESTADDRREQ: return "EDESTADDRREQ";
126 #endif
127 #ifdef EDIRTY
128 case EDIRTY: return "EDIRTY";
129 #endif
130 #ifdef EDOM
131 case EDOM: return "EDOM";
132 #endif
133 #ifdef EDOTDOT
134 case EDOTDOT: return "EDOTDOT";
135 #endif
136 #ifdef EDQUOT
137 case EDQUOT: return "EDQUOT";
138 #endif
139 #ifdef EDUPPKG
140 case EDUPPKG: return "EDUPPKG";
141 #endif
142 #ifdef EEXIST
143 case EEXIST: return "EEXIST";
144 #endif
145 #ifdef EFAULT
146 case EFAULT: return "EFAULT";
147 #endif
148 #ifdef EFBIG
149 case EFBIG: return "EFBIG";
150 #endif
151 #ifdef EHOSTDOWN
152 case EHOSTDOWN: return "EHOSTDOWN";
153 #endif
154 #ifdef EHOSTUNREACH
155 case EHOSTUNREACH: return "EHOSTUNREACH";
156 #endif
157 #if defined(EIDRM) && (!defined(EINPROGRESS) || (EIDRM != EINPROGRESS))
158 case EIDRM: return "EIDRM";
159 #endif
160 #ifdef EINIT
161 case EINIT: return "EINIT";
162 #endif
163 #ifdef EINPROGRESS
164 case EINPROGRESS: return "EINPROGRESS";
165 #endif
166 #ifdef EINTR
167 case EINTR: return "EINTR";
168 #endif
169 #ifdef EINVAL
170 case EINVAL: return "EINVAL";
171 #endif
172 #ifdef EIO
173 case EIO: return "EIO";
174 #endif
175 #ifdef EISCONN
176 case EISCONN: return "EISCONN";
177 #endif
178 #ifdef EISDIR
179 case EISDIR: return "EISDIR";
180 #endif
181 #ifdef EISNAME
182 case EISNAM: return "EISNAM";
183 #endif
184 #ifdef ELBIN
185 case ELBIN: return "ELBIN";
186 #endif
187 #ifdef EL2HLT
188 case EL2HLT: return "EL2HLT";
189 #endif
190 #ifdef EL2NSYNC
191 case EL2NSYNC: return "EL2NSYNC";
192 #endif
193 #ifdef EL3HLT
194 case EL3HLT: return "EL3HLT";
195 #endif
196 #ifdef EL3RST
197 case EL3RST: return "EL3RST";
198 #endif
199 #ifdef ELIBACC
200 case ELIBACC: return "ELIBACC";
201 #endif
202 #ifdef ELIBBAD
203 case ELIBBAD: return "ELIBBAD";
204 #endif
205 #ifdef ELIBEXEC
206 case ELIBEXEC: return "ELIBEXEC";
207 #endif
208 #ifdef ELIBMAX
209 case ELIBMAX: return "ELIBMAX";
210 #endif
211 #ifdef ELIBSCN
212 case ELIBSCN: return "ELIBSCN";
213 #endif
214 #ifdef ELNRNG
215 case ELNRNG: return "ELNRNG";
216 #endif
217 #if defined(ELOOP) && (!defined(ENOENT) || (ELOOP != ENOENT))
218 case ELOOP: return "ELOOP";
219 #endif
220 #ifdef EMFILE
221 case EMFILE: return "EMFILE";
222 #endif
223 #ifdef EMLINK
224 case EMLINK: return "EMLINK";
225 #endif
226 #ifdef EMSGSIZE
227 case EMSGSIZE: return "EMSGSIZE";
228 #endif
229 #ifdef EMULTIHOP
230 case EMULTIHOP: return "EMULTIHOP";
231 #endif
232 #ifdef ENAMETOOLONG
233 case ENAMETOOLONG: return "ENAMETOOLONG";
234 #endif
235 #ifdef ENAVAIL
236 case ENAVAIL: return "ENAVAIL";
237 #endif
238 #ifdef ENET
239 case ENET: return "ENET";
240 #endif
241 #ifdef ENETDOWN
242 case ENETDOWN: return "ENETDOWN";
243 #endif
244 #ifdef ENETRESET
245 case ENETRESET: return "ENETRESET";
246 #endif
247 #ifdef ENETUNREACH
248 case ENETUNREACH: return "ENETUNREACH";
249 #endif
250 #ifdef ENFILE
251 case ENFILE: return "ENFILE";
252 #endif
253 #ifdef ENOANO
254 case ENOANO: return "ENOANO";
255 #endif
256 #if defined(ENOBUFS) && (!defined(ENOSR) || (ENOBUFS != ENOSR))
257 case ENOBUFS: return "ENOBUFS";
258 #endif
259 #ifdef ENOCSI
260 case ENOCSI: return "ENOCSI";
261 #endif
262 #if defined(ENODATA) && (!defined(ECONNREFUSED) || (ENODATA != ECONNREFUSED))
263 case ENODATA: return "ENODATA";
264 #endif
265 #ifdef ENODEV
266 case ENODEV: return "ENODEV";
267 #endif
268 #ifdef ENOENT
269 case ENOENT: return "ENOENT";
270 #endif
271 #ifdef ENOEXEC
272 case ENOEXEC: return "ENOEXEC";
273 #endif
274 #ifdef ENOLCK
275 case ENOLCK: return "ENOLCK";
276 #endif
277 #ifdef ENOLINK
278 case ENOLINK: return "ENOLINK";
279 #endif
280 #ifdef ENOMEM
281 case ENOMEM: return "ENOMEM";
282 #endif
283 #ifdef ENOMSG
284 case ENOMSG: return "ENOMSG";
285 #endif
286 #ifdef ENONET
287 case ENONET: return "ENONET";
288 #endif
289 #ifdef ENOPKG
290 case ENOPKG: return "ENOPKG";
291 #endif
292 #ifdef ENOPROTOOPT
293 case ENOPROTOOPT: return "ENOPROTOOPT";
294 #endif
295 #ifdef ENOSPC
296 case ENOSPC: return "ENOSPC";
297 #endif
298 #if defined(ENOSR) && (!defined(ENAMETOOLONG) || (ENAMETOOLONG != ENOSR))
299 case ENOSR: return "ENOSR";
300 #endif
301 #if defined(ENOSTR) && (!defined(ENOTTY) || (ENOTTY != ENOSTR))
302 case ENOSTR: return "ENOSTR";
303 #endif
304 #ifdef ENOSYM
305 case ENOSYM: return "ENOSYM";
306 #endif
307 #ifdef ENOSYS
308 case ENOSYS: return "ENOSYS";
309 #endif
310 #ifdef ENOTBLK
311 case ENOTBLK: return "ENOTBLK";
312 #endif
313 #ifdef ENOTCONN
314 case ENOTCONN: return "ENOTCONN";
315 #endif
316 #ifdef ENOTDIR
317 case ENOTDIR: return "ENOTDIR";
318 #endif
319 #if defined(ENOTEMPTY) && (!defined(EEXIST) || (ENOTEMPTY != EEXIST))
320 case ENOTEMPTY: return "ENOTEMPTY";
321 #endif
322 #ifdef ENOTNAM
323 case ENOTNAM: return "ENOTNAM";
324 #endif
325 #ifdef ENOTSOCK
326 case ENOTSOCK: return "ENOTSOCK";
327 #endif
328 #ifdef ENOTSUP
329 case ENOTSUP: return "ENOTSUP";
330 #endif
331 #ifdef ENOTTY
332 case ENOTTY: return "ENOTTY";
333 #endif
334 #ifdef ENOTUNIQ
335 case ENOTUNIQ: return "ENOTUNIQ";
336 #endif
337 #ifdef ENXIO
338 case ENXIO: return "ENXIO";
339 #endif
340 #if defined(EOPNOTSUPP) && (!defined(ENOTSUP) || (ENOTSUP != EOPNOTSUPP))
341 case EOPNOTSUPP: return "EOPNOTSUPP";
342 #endif
343 #ifdef EPERM
344 case EPERM: return "EPERM";
345 #endif
346 #if defined(EPFNOSUPPORT) && (!defined(ENOLCK) || (ENOLCK != EPFNOSUPPORT))
347 case EPFNOSUPPORT: return "EPFNOSUPPORT";
348 #endif
349 #ifdef EPIPE
350 case EPIPE: return "EPIPE";
351 #endif
352 #ifdef EPROCLIM
353 case EPROCLIM: return "EPROCLIM";
354 #endif
355 #ifdef EPROCUNAVAIL
356 case EPROCUNAVAIL: return "EPROCUNAVAIL";
357 #endif
358 #ifdef EPROGMISMATCH
359 case EPROGMISMATCH: return "EPROGMISMATCH";
360 #endif
361 #ifdef EPROGUNAVAIL
362 case EPROGUNAVAIL: return "EPROGUNAVAIL";
363 #endif
364 #ifdef EPROTO
365 case EPROTO: return "EPROTO";
366 #endif
367 #ifdef EPROTONOSUPPORT
368 case EPROTONOSUPPORT: return "EPROTONOSUPPORT";
369 #endif
370 #ifdef EPROTOTYPE
371 case EPROTOTYPE: return "EPROTOTYPE";
372 #endif
373 #ifdef ERANGE
374 case ERANGE: return "ERANGE";
375 #endif
376 #if defined(EREFUSED) && (!defined(ECONNREFUSED) || (EREFUSED != ECONNREFUSED))
377 case EREFUSED: return "EREFUSED";
378 #endif
379 #ifdef EREMCHG
380 case EREMCHG: return "EREMCHG";
381 #endif
382 #ifdef EREMDEV
383 case EREMDEV: return "EREMDEV";
384 #endif
385 #ifdef EREMOTE
386 case EREMOTE: return "EREMOTE";
387 #endif
388 #ifdef EREMOTEIO
389 case EREMOTEIO: return "EREMOTEIO";
390 #endif
391 #ifdef EREMOTERELEASE
392 case EREMOTERELEASE: return "EREMOTERELEASE";
393 #endif
394 #ifdef EROFS
395 case EROFS: return "EROFS";
396 #endif
397 #ifdef ERPCMISMATCH
398 case ERPCMISMATCH: return "ERPCMISMATCH";
399 #endif
400 #ifdef ERREMOTE
401 case ERREMOTE: return "ERREMOTE";
402 #endif
403 #ifdef ESHUTDOWN
404 case ESHUTDOWN: return "ESHUTDOWN";
405 #endif
406 #ifdef ESOCKTNOSUPPORT
407 case ESOCKTNOSUPPORT: return "ESOCKTNOSUPPORT";
408 #endif
409 #ifdef ESPIPE
410 case ESPIPE: return "ESPIPE";
411 #endif
412 #ifdef ESRCH
413 case ESRCH: return "ESRCH";
414 #endif
415 #ifdef ESRMNT
416 case ESRMNT: return "ESRMNT";
417 #endif
418 #ifdef ESTALE
419 case ESTALE: return "ESTALE";
420 #endif
421 #ifdef ESUCCESS
422 case ESUCCESS: return "ESUCCESS";
423 #endif
424 #if defined(ETIME) && (!defined(ELOOP) || (ETIME != ELOOP))
425 case ETIME: return "ETIME";
426 #endif
427 #if defined(ETIMEDOUT) && (!defined(ENOSTR) || (ETIMEDOUT != ENOSTR))
428 case ETIMEDOUT: return "ETIMEDOUT";
429 #endif
430 #ifdef ETOOMANYREFS
431 case ETOOMANYREFS: return "ETOOMANYREFS";
432 #endif
433 #ifdef ETXTBSY
434 case ETXTBSY: return "ETXTBSY";
435 #endif
436 #ifdef EUCLEAN
437 case EUCLEAN: return "EUCLEAN";
438 #endif
439 #ifdef EUNATCH
440 case EUNATCH: return "EUNATCH";
441 #endif
442 #ifdef EUSERS
443 case EUSERS: return "EUSERS";
444 #endif
445 #ifdef EVERSION
446 case EVERSION: return "EVERSION";
447 #endif
448 #if defined(EWOULDBLOCK) && (!defined(EAGAIN) || (EWOULDBLOCK != EAGAIN))
449 case EWOULDBLOCK: return "EWOULDBLOCK";
450 #endif
451 #ifdef EXDEV
452 case EXDEV: return "EXDEV";
453 #endif
454 #ifdef EXFULL
455 case EXFULL: return "EXFULL";
456 #endif
457 }
458 return "unknown error";
459 }
460
461 /*
462 *----------------------------------------------------------------------
463 *
464 * Tcl_ErrnoMsg --
465 *
466 * Return a human-readable message corresponding to a given
467 * errno value.
468 *
469 * Results:
470 * The return value is the standard POSIX error message for
471 * errno. This procedure is used instead of strerror because
472 * strerror returns slightly different values on different
473 * machines (e.g. different capitalizations), which cause
474 * problems for things such as regression tests. This procedure
475 * provides messages for most standard errors, then it calls
476 * strerror for things it doesn't understand.
477 *
478 * Side effects:
479 * None.
480 *
481 *----------------------------------------------------------------------
482 */
483
484 char *
485 Tcl_ErrnoMsg(err)
486 int err; /* Error number (such as in errno variable). */
487 {
488 switch (err) {
489 #ifdef E2BIG
490 case E2BIG: return "argument list too long";
491 #endif
492 #ifdef EACCES
493 case EACCES: return "permission denied";
494 #endif
495 #ifdef EADDRINUSE
496 case EADDRINUSE: return "address already in use";
497 #endif
498 #ifdef EADDRNOTAVAIL
499 case EADDRNOTAVAIL: return "can't assign requested address";
500 #endif
501 #ifdef EADV
502 case EADV: return "advertise error";
503 #endif
504 #ifdef EAFNOSUPPORT
505 case EAFNOSUPPORT: return "address family not supported by protocol family";
506 #endif
507 #ifdef EAGAIN
508 case EAGAIN: return "resource temporarily unavailable";
509 #endif
510 #ifdef EALIGN
511 case EALIGN: return "EALIGN";
512 #endif
513 #if defined(EALREADY) && (!defined(EBUSY) || (EALREADY != EBUSY ))
514 case EALREADY: return "operation already in progress";
515 #endif
516 #ifdef EBADE
517 case EBADE: return "bad exchange descriptor";
518 #endif
519 #ifdef EBADF
520 case EBADF: return "bad file number";
521 #endif
522 #ifdef EBADFD
523 case EBADFD: return "file descriptor in bad state";
524 #endif
525 #ifdef EBADMSG
526 case EBADMSG: return "not a data message";
527 #endif
528 #ifdef EBADR
529 case EBADR: return "bad request descriptor";
530 #endif
531 #ifdef EBADRPC
532 case EBADRPC: return "RPC structure is bad";
533 #endif
534 #ifdef EBADRQC
535 case EBADRQC: return "bad request code";
536 #endif
537 #ifdef EBADSLT
538 case EBADSLT: return "invalid slot";
539 #endif
540 #ifdef EBFONT
541 case EBFONT: return "bad font file format";
542 #endif
543 #ifdef EBUSY
544 case EBUSY: return "file busy";
545 #endif
546 #ifdef ECHILD
547 case ECHILD: return "no children";
548 #endif
549 #ifdef ECHRNG
550 case ECHRNG: return "channel number out of range";
551 #endif
552 #ifdef ECOMM
553 case ECOMM: return "communication error on send";
554 #endif
555 #ifdef ECONNABORTED
556 case ECONNABORTED: return "software caused connection abort";
557 #endif
558 #ifdef ECONNREFUSED
559 case ECONNREFUSED: return "connection refused";
560 #endif
561 #ifdef ECONNRESET
562 case ECONNRESET: return "connection reset by peer";
563 #endif
564 #if defined(EDEADLK) && (!defined(EWOULDBLOCK) || (EDEADLK != EWOULDBLOCK))
565 case EDEADLK: return "resource deadlock avoided";
566 #endif
567 #if defined(EDEADLOCK) && (!defined(EDEADLK) || (EDEADLOCK != EDEADLK))
568 case EDEADLOCK: return "resource deadlock avoided";
569 #endif
570 #ifdef EDESTADDRREQ
571 case EDESTADDRREQ: return "destination address required";
572 #endif
573 #ifdef EDIRTY
574 case EDIRTY: return "mounting a dirty fs w/o force";
575 #endif
576 #ifdef EDOM
577 case EDOM: return "math argument out of range";
578 #endif
579 #ifdef EDOTDOT
580 case EDOTDOT: return "cross mount point";
581 #endif
582 #ifdef EDQUOT
583 case EDQUOT: return "disk quota exceeded";
584 #endif
585 #ifdef EDUPPKG
586 case EDUPPKG: return "duplicate package name";
587 #endif
588 #ifdef EEXIST
589 case EEXIST: return "file already exists";
590 #endif
591 #ifdef EFAULT
592 case EFAULT: return "bad address in system call argument";
593 #endif
594 #ifdef EFBIG
595 case EFBIG: return "file too large";
596 #endif
597 #ifdef EHOSTDOWN
598 case EHOSTDOWN: return "host is down";
599 #endif
600 #ifdef EHOSTUNREACH
601 case EHOSTUNREACH: return "host is unreachable";
602 #endif
603 #if defined(EIDRM) && (!defined(EINPROGRESS) || (EIDRM != EINPROGRESS))
604 case EIDRM: return "identifier removed";
605 #endif
606 #ifdef EINIT
607 case EINIT: return "initialization error";
608 #endif
609 #ifdef EINPROGRESS
610 case EINPROGRESS: return "operation now in progress";
611 #endif
612 #ifdef EINTR
613 case EINTR: return "interrupted system call";
614 #endif
615 #ifdef EINVAL
616 case EINVAL: return "invalid argument";
617 #endif
618 #ifdef EIO
619 case EIO: return "I/O error";
620 #endif
621 #ifdef EISCONN
622 case EISCONN: return "socket is already connected";
623 #endif
624 #ifdef EISDIR
625 case EISDIR: return "illegal operation on a directory";
626 #endif
627 #ifdef EISNAME
628 case EISNAM: return "is a name file";
629 #endif
630 #ifdef ELBIN
631 case ELBIN: return "ELBIN";
632 #endif
633 #ifdef EL2HLT
634 case EL2HLT: return "level 2 halted";
635 #endif
636 #ifdef EL2NSYNC
637 case EL2NSYNC: return "level 2 not synchronized";
638 #endif
639 #ifdef EL3HLT
640 case EL3HLT: return "level 3 halted";
641 #endif
642 #ifdef EL3RST
643 case EL3RST: return "level 3 reset";
644 #endif
645 #ifdef ELIBACC
646 case ELIBACC: return "can not access a needed shared library";
647 #endif
648 #ifdef ELIBBAD
649 case ELIBBAD: return "accessing a corrupted shared library";
650 #endif
651 #ifdef ELIBEXEC
652 case ELIBEXEC: return "can not exec a shared library directly";
653 #endif
654 #ifdef ELIBMAX
655 case ELIBMAX: return
656 "attempting to link in more shared libraries than system limit";
657 #endif
658 #ifdef ELIBSCN
659 case ELIBSCN: return ".lib section in a.out corrupted";
660 #endif
661 #ifdef ELNRNG
662 case ELNRNG: return "link number out of range";
663 #endif
664 #if defined(ELOOP) && (!defined(ENOENT) || (ELOOP != ENOENT))
665 case ELOOP: return "too many levels of symbolic links";
666 #endif
667 #ifdef EMFILE
668 case EMFILE: return "too many open files";
669 #endif
670 #ifdef EMLINK
671 case EMLINK: return "too many links";
672 #endif
673 #ifdef EMSGSIZE
674 case EMSGSIZE: return "message too long";
675 #endif
676 #ifdef EMULTIHOP
677 case EMULTIHOP: return "multihop attempted";
678 #endif
679 #ifdef ENAMETOOLONG
680 case ENAMETOOLONG: return "file name too long";
681 #endif
682 #ifdef ENAVAIL
683 case ENAVAIL: return "not available";
684 #endif
685 #ifdef ENET
686 case ENET: return "ENET";
687 #endif
688 #ifdef ENETDOWN
689 case ENETDOWN: return "network is down";
690 #endif
691 #ifdef ENETRESET
692 case ENETRESET: return "network dropped connection on reset";
693 #endif
694 #ifdef ENETUNREACH
695 case ENETUNREACH: return "network is unreachable";
696 #endif
697 #ifdef ENFILE
698 case ENFILE: return "file table overflow";
699 #endif
700 #ifdef ENOANO
701 case ENOANO: return "anode table overflow";
702 #endif
703 #if defined(ENOBUFS) && (!defined(ENOSR) || (ENOBUFS != ENOSR))
704 case ENOBUFS: return "no buffer space available";
705 #endif
706 #ifdef ENOCSI
707 case ENOCSI: return "no CSI structure available";
708 #endif
709 #if defined(ENODATA) && (!defined(ECONNREFUSED) || (ENODATA != ECONNREFUSED))
710 case ENODATA: return "no data available";
711 #endif
712 #ifdef ENODEV
713 case ENODEV: return "no such device";
714 #endif
715 #ifdef ENOENT
716 case ENOENT: return "no such file or directory";
717 #endif
718 #ifdef ENOEXEC
719 case ENOEXEC: return "exec format error";
720 #endif
721 #ifdef ENOLCK
722 case ENOLCK: return "no locks available";
723 #endif
724 #ifdef ENOLINK
725 case ENOLINK: return "link has be severed";
726 #endif
727 #ifdef ENOMEM
728 case ENOMEM: return "not enough memory";
729 #endif
730 #ifdef ENOMSG
731 case ENOMSG: return "no message of desired type";
732 #endif
733 #ifdef ENONET
734 case ENONET: return "machine is not on the network";
735 #endif
736 #ifdef ENOPKG
737 case ENOPKG: return "package not installed";
738 #endif
739 #ifdef ENOPROTOOPT
740 case ENOPROTOOPT: return "bad protocol option";
741 #endif
742 #ifdef ENOSPC
743 case ENOSPC: return "no space left on device";
744 #endif
745 #if defined(ENOSR) && (!defined(ENAMETOOLONG) || (ENAMETOOLONG != ENOSR))
746 case ENOSR: return "out of stream resources";
747 #endif
748 #if defined(ENOSTR) && (!defined(ENOTTY) || (ENOTTY != ENOSTR))
749 case ENOSTR: return "not a stream device";
750 #endif
751 #ifdef ENOSYM
752 case ENOSYM: return "unresolved symbol name";
753 #endif
754 #ifdef ENOSYS
755 case ENOSYS: return "function not implemented";
756 #endif
757 #ifdef ENOTBLK
758 case ENOTBLK: return "block device required";
759 #endif
760 #ifdef ENOTCONN
761 case ENOTCONN: return "socket is not connected";
762 #endif
763 #ifdef ENOTDIR
764 case ENOTDIR: return "not a directory";
765 #endif
766 #if defined(ENOTEMPTY) && (!defined(EEXIST) || (ENOTEMPTY != EEXIST))
767 case ENOTEMPTY: return "directory not empty";
768 #endif
769 #ifdef ENOTNAM
770 case ENOTNAM: return "not a name file";
771 #endif
772 #ifdef ENOTSOCK
773 case ENOTSOCK: return "socket operation on non-socket";
774 #endif
775 #ifdef ENOTSUP
776 case ENOTSUP: return "operation not supported";
777 #endif
778 #ifdef ENOTTY
779 case ENOTTY: return "inappropriate device for ioctl";
780 #endif
781 #ifdef ENOTUNIQ
782 case ENOTUNIQ: return "name not unique on network";
783 #endif
784 #ifdef ENXIO
785 case ENXIO: return "no such device or address";
786 #endif
787 #if defined(EOPNOTSUPP) && (!defined(ENOTSUP) || (ENOTSUP != EOPNOTSUPP))
788 case EOPNOTSUPP: return "operation not supported on socket";
789 #endif
790 #ifdef EPERM
791 case EPERM: return "not owner";
792 #endif
793 #if defined(EPFNOSUPPORT) && (!defined(ENOLCK) || (ENOLCK != EPFNOSUPPORT))
794 case EPFNOSUPPORT: return "protocol family not supported";
795 #endif
796 #ifdef EPIPE
797 case EPIPE: return "broken pipe";
798 #endif
799 #ifdef EPROCLIM
800 case EPROCLIM: return "too many processes";
801 #endif
802 #ifdef EPROCUNAVAIL
803 case EPROCUNAVAIL: return "bad procedure for program";
804 #endif
805 #ifdef EPROGMISMATCH
806 case EPROGMISMATCH: return "program version wrong";
807 #endif
808 #ifdef EPROGUNAVAIL
809 case EPROGUNAVAIL: return "RPC program not available";
810 #endif
811 #ifdef EPROTO
812 case EPROTO: return "protocol error";
813 #endif
814 #ifdef EPROTONOSUPPORT
815 case EPROTONOSUPPORT: return "protocol not suppored";
816 #endif
817 #ifdef EPROTOTYPE
818 case EPROTOTYPE: return "protocol wrong type for socket";
819 #endif
820 #ifdef ERANGE
821 case ERANGE: return "math result unrepresentable";
822 #endif
823 #if defined(EREFUSED) && (!defined(ECONNREFUSED) || (EREFUSED != ECONNREFUSED))
824 case EREFUSED: return "EREFUSED";
825 #endif
826 #ifdef EREMCHG
827 case EREMCHG: return "remote address changed";
828 #endif
829 #ifdef EREMDEV
830 case EREMDEV: return "remote device";
831 #endif
832 #ifdef EREMOTE
833 case EREMOTE: return "pathname hit remote file system";
834 #endif
835 #ifdef EREMOTEIO
836 case EREMOTEIO: return "remote i/o error";
837 #endif
838 #ifdef EREMOTERELEASE
839 case EREMOTERELEASE: return "EREMOTERELEASE";
840 #endif
841 #ifdef EROFS
842 case EROFS: return "read-only file system";
843 #endif
844 #ifdef ERPCMISMATCH
845 case ERPCMISMATCH: return "RPC version is wrong";
846 #endif
847 #ifdef ERREMOTE
848 case ERREMOTE: return "object is remote";
849 #endif
850 #ifdef ESHUTDOWN
851 case ESHUTDOWN: return "can't send afer socket shutdown";
852 #endif
853 #ifdef ESOCKTNOSUPPORT
854 case ESOCKTNOSUPPORT: return "socket type not supported";
855 #endif
856 #ifdef ESPIPE
857 case ESPIPE: return "invalid seek";
858 #endif
859 #ifdef ESRCH
860 case ESRCH: return "no such process";
861 #endif
862 #ifdef ESRMNT
863 case ESRMNT: return "srmount error";
864 #endif
865 #ifdef ESTALE
866 case ESTALE: return "stale remote file handle";
867 #endif
868 #ifdef ESUCCESS
869 case ESUCCESS: return "Error 0";
870 #endif
871 #if defined(ETIME) && (!defined(ELOOP) || (ETIME != ELOOP))
872 case ETIME: return "timer expired";
873 #endif
874 #if defined(ETIMEDOUT) && (!defined(ENOSTR) || (ETIMEDOUT != ENOSTR))
875 case ETIMEDOUT: return "connection timed out";
876 #endif
877 #ifdef ETOOMANYREFS
878 case ETOOMANYREFS: return "too many references: can't splice";
879 #endif
880 #ifdef ETXTBSY
881 case ETXTBSY: return "text file or pseudo-device busy";
882 #endif
883 #ifdef EUCLEAN
884 case EUCLEAN: return "structure needs cleaning";
885 #endif
886 #ifdef EUNATCH
887 case EUNATCH: return "protocol driver not attached";
888 #endif
889 #ifdef EUSERS
890 case EUSERS: return "too many users";
891 #endif
892 #ifdef EVERSION
893 case EVERSION: return "version mismatch";
894 #endif
895 #if defined(EWOULDBLOCK) && (!defined(EAGAIN) || (EWOULDBLOCK != EAGAIN))
896 case EWOULDBLOCK: return "operation would block";
897 #endif
898 #ifdef EXDEV
899 case EXDEV: return "cross-domain link";
900 #endif
901 #ifdef EXFULL
902 case EXFULL: return "message tables full";
903 #endif
904 default:
905 #ifdef NO_STRERROR
906 return "unknown POSIX error";
907 #else
908 return strerror(errno);
909 #endif
910 }
911 }
912
913 /*
914 *----------------------------------------------------------------------
915 *
916 * Tcl_SignalId --
917 *
918 * Return a textual identifier for a signal number.
919 *
920 * Results:
921 * This procedure returns a machine-readable textual identifier
922 * that corresponds to sig. The identifier is the same as the
923 * #define name in signal.h.
924 *
925 * Side effects:
926 * None.
927 *
928 *----------------------------------------------------------------------
929 */
930
931 char *
932 Tcl_SignalId(sig)
933 int sig; /* Number of signal. */
934 {
935 switch (sig) {
936 #ifdef SIGABRT
937 case SIGABRT: return "SIGABRT";
938 #endif
939 #ifdef SIGALRM
940 case SIGALRM: return "SIGALRM";
941 #endif
942 #ifdef SIGBUS
943 case SIGBUS: return "SIGBUS";
944 #endif
945 #ifdef SIGCHLD
946 case SIGCHLD: return "SIGCHLD";
947 #endif
948 #if defined(SIGCLD) && (!defined(SIGCHLD) || (SIGCLD != SIGCHLD))
949 case SIGCLD: return "SIGCLD";
950 #endif
951 #ifdef SIGCONT
952 case SIGCONT: return "SIGCONT";
953 #endif
954 #if defined(SIGEMT) && (!defined(SIGXCPU) || (SIGEMT != SIGXCPU))
955 case SIGEMT: return "SIGEMT";
956 #endif
957 #ifdef SIGFPE
958 case SIGFPE: return "SIGFPE";
959 #endif
960 #ifdef SIGHUP
961 case SIGHUP: return "SIGHUP";
962 #endif
963 #ifdef SIGILL
964 case SIGILL: return "SIGILL";
965 #endif
966 #ifdef SIGINT
967 case SIGINT: return "SIGINT";
968 #endif
969 #ifdef SIGIO
970 case SIGIO: return "SIGIO";
971 #endif
972 #if defined(SIGIOT) && (!defined(SIGABRT) || (SIGIOT != SIGABRT))
973 case SIGIOT: return "SIGIOT";
974 #endif
975 #ifdef SIGKILL
976 case SIGKILL: return "SIGKILL";
977 #endif
978 #if defined(SIGLOST) && (!defined(SIGIOT) || (SIGLOST != SIGIOT)) && (!defined(SIGURG) || (SIGLOST != SIGURG)) && (!defined(SIGPROF) || (SIGLOST != SIGPROF)) && (!defined(SIGIO) || (SIGLOST != SIGIO))
979 case SIGLOST: return "SIGLOST";
980 #endif
981 #ifdef SIGPIPE
982 case SIGPIPE: return "SIGPIPE";
983 #endif
984 #if defined(SIGPOLL) && (!defined(SIGIO) || (SIGPOLL != SIGIO))
985 case SIGPOLL: return "SIGPOLL";
986 #endif
987 #ifdef SIGPROF
988 case SIGPROF: return "SIGPROF";
989 #endif
990 #if defined(SIGPWR) && (!defined(SIGXFSZ) || (SIGPWR != SIGXFSZ))
991 case SIGPWR: return "SIGPWR";
992 #endif
993 #ifdef SIGQUIT
994 case SIGQUIT: return "SIGQUIT";
995 #endif
996 #ifdef SIGSEGV
997 case SIGSEGV: return "SIGSEGV";
998 #endif
999 #ifdef SIGSTOP
1000 case SIGSTOP: return "SIGSTOP";
1001 #endif
1002 #ifdef SIGSYS
1003 case SIGSYS: return "SIGSYS";
1004 #endif
1005 #ifdef SIGTERM
1006 case SIGTERM: return "SIGTERM";
1007 #endif
1008 #ifdef SIGTRAP
1009 case SIGTRAP: return "SIGTRAP";
1010 #endif
1011 #ifdef SIGTSTP
1012 case SIGTSTP: return "SIGTSTP";
1013 #endif
1014 #ifdef SIGTTIN
1015 case SIGTTIN: return "SIGTTIN";
1016 #endif
1017 #ifdef SIGTTOU
1018 case SIGTTOU: return "SIGTTOU";
1019 #endif
1020 #if defined(SIGURG) && (!defined(SIGIO) || (SIGURG != SIGIO))
1021 case SIGURG: return "SIGURG";
1022 #endif
1023 #if defined(SIGUSR1) && (!defined(SIGIO) || (SIGUSR1 != SIGIO))
1024 case SIGUSR1: return "SIGUSR1";
1025 #endif
1026 #if defined(SIGUSR2) && (!defined(SIGURG) || (SIGUSR2 != SIGURG))
1027 case SIGUSR2: return "SIGUSR2";
1028 #endif
1029 #ifdef SIGVTALRM
1030 case SIGVTALRM: return "SIGVTALRM";
1031 #endif
1032 #ifdef SIGWINCH
1033 case SIGWINCH: return "SIGWINCH";
1034 #endif
1035 #ifdef SIGXCPU
1036 case SIGXCPU: return "SIGXCPU";
1037 #endif
1038 #ifdef SIGXFSZ
1039 case SIGXFSZ: return "SIGXFSZ";
1040 #endif
1041 }
1042 return "unknown signal";
1043 }
1044
1045 /*
1046 *----------------------------------------------------------------------
1047 *
1048 * Tcl_SignalMsg --
1049 *
1050 * Return a human-readable message describing a signal.
1051 *
1052 * Results:
1053 * This procedure returns a string describing sig that should
1054 * make sense to a human. It may not be easy for a machine
1055 * to parse.
1056 *
1057 * Side effects:
1058 * None.
1059 *
1060 *----------------------------------------------------------------------
1061 */
1062
1063 char *
1064 Tcl_SignalMsg(sig)
1065 int sig; /* Number of signal. */
1066 {
1067 switch (sig) {
1068 #ifdef SIGABRT
1069 case SIGABRT: return "SIGABRT";
1070 #endif
1071 #ifdef SIGALRM
1072 case SIGALRM: return "alarm clock";
1073 #endif
1074 #ifdef SIGBUS
1075 case SIGBUS: return "bus error";
1076 #endif
1077 #ifdef SIGCHLD
1078 case SIGCHLD: return "child status changed";
1079 #endif
1080 #if defined(SIGCLD) && (!defined(SIGCHLD) || (SIGCLD != SIGCHLD))
1081 case SIGCLD: return "child status changed";
1082 #endif
1083 #ifdef SIGCONT
1084 case SIGCONT: return "continue after stop";
1085 #endif
1086 #if defined(SIGEMT) && (!defined(SIGXCPU) || (SIGEMT != SIGXCPU))
1087 case SIGEMT: return "EMT instruction";
1088 #endif
1089 #ifdef SIGFPE
1090 case SIGFPE: return "floating-point exception";
1091 #endif
1092 #ifdef SIGHUP
1093 case SIGHUP: return "hangup";
1094 #endif
1095 #ifdef SIGILL
1096 case SIGILL: return "illegal instruction";
1097 #endif
1098 #ifdef SIGINT
1099 case SIGINT: return "interrupt";
1100 #endif
1101 #ifdef SIGIO
1102 case SIGIO: return "input/output possible on file";
1103 #endif
1104 #if defined(SIGIOT) && (!defined(SIGABRT) || (SIGABRT != SIGIOT))
1105 case SIGIOT: return "IOT instruction";
1106 #endif
1107 #ifdef SIGKILL
1108 case SIGKILL: return "kill signal";
1109 #endif
1110 #if defined(SIGLOST) && (!defined(SIGIOT) || (SIGLOST != SIGIOT)) && (!defined(SIGURG) || (SIGLOST != SIGURG)) && (!defined(SIGPROF) || (SIGLOST != SIGPROF)) && (!defined(SIGIO) || (SIGLOST != SIGIO))
1111 case SIGLOST: return "resource lost";
1112 #endif
1113 #ifdef SIGPIPE
1114 case SIGPIPE: return "write on pipe with no readers";
1115 #endif
1116 #if defined(SIGPOLL) && (!defined(SIGIO) || (SIGPOLL != SIGIO))
1117 case SIGPOLL: return "input/output possible on file";
1118 #endif
1119 #ifdef SIGPROF
1120 case SIGPROF: return "profiling alarm";
1121 #endif
1122 #if defined(SIGPWR) && (!defined(SIGXFSZ) || (SIGPWR != SIGXFSZ))
1123 case SIGPWR: return "power-fail restart";
1124 #endif
1125 #ifdef SIGQUIT
1126 case SIGQUIT: return "quit signal";
1127 #endif
1128 #ifdef SIGSEGV
1129 case SIGSEGV: return "segmentation violation";
1130 #endif
1131 #ifdef SIGSTOP
1132 case SIGSTOP: return "stop";
1133 #endif
1134 #ifdef SIGSYS
1135 case SIGSYS: return "bad argument to system call";
1136 #endif
1137 #ifdef SIGTERM
1138 case SIGTERM: return "software termination signal";
1139 #endif
1140 #ifdef SIGTRAP
1141 case SIGTRAP: return "trace trap";
1142 #endif
1143 #ifdef SIGTSTP
1144 case SIGTSTP: return "stop signal from tty";
1145 #endif
1146 #ifdef SIGTTIN
1147 case SIGTTIN: return "background tty read";
1148 #endif
1149 #ifdef SIGTTOU
1150 case SIGTTOU: return "background tty write";
1151 #endif
1152 #if defined(SIGURG) && (!defined(SIGIO) || (SIGURG != SIGIO))
1153 case SIGURG: return "urgent I/O condition";
1154 #endif
1155 #if defined(SIGUSR1) && (!defined(SIGIO) || (SIGUSR1 != SIGIO))
1156 case SIGUSR1: return "user-defined signal 1";
1157 #endif
1158 #if defined(SIGUSR2) && (!defined(SIGURG) || (SIGUSR2 != SIGURG))
1159 case SIGUSR2: return "user-defined signal 2";
1160 #endif
1161 #ifdef SIGVTALRM
1162 case SIGVTALRM: return "virtual time alarm";
1163 #endif
1164 #ifdef SIGWINCH
1165 case SIGWINCH: return "window changed";
1166 #endif
1167 #ifdef SIGXCPU
1168 case SIGXCPU: return "exceeded CPU time limit";
1169 #endif
1170 #ifdef SIGXFSZ
1171 case SIGXFSZ: return "exceeded file size limit";
1172 #endif
1173 }
1174 return "unknown signal";
1175 }
1176
1177 /* End of tclposixstr.c */

Properties

Name Value
svn:eol-style native
svn:keywords Header

dashley@gmail.com
ViewVC Help
Powered by ViewVC 1.1.25