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