Commit | Line | Data |
---|---|---|
805e021f CE |
1 | /* |
2 | * Copyright 2000, International Business Machines Corporation and others. | |
3 | * All Rights Reserved. | |
4 | * | |
5 | * This software has been released under the terms of the IBM Public | |
6 | * License. For details, see the LICENSE file in the top-level source | |
7 | * directory or online at http://www.openafs.org/dl/license10.html | |
8 | */ | |
9 | ||
10 | #include <afsconfig.h> | |
11 | #include <afs/param.h> | |
12 | ||
13 | #include <roken.h> | |
14 | ||
15 | #include <afs/com_err.h> | |
16 | #include <rx/rxkad.h> | |
17 | #include <afs/kautils.h> | |
18 | #include <afs/cellconfig.h> | |
19 | #include <afs/cmd.h> | |
20 | #include <afs/vlserver.h> | |
21 | #include <afs/pterror.h> | |
22 | #include <afs/bnode.h> | |
23 | #include <afs/afsint.h> | |
24 | #include <afs/volser.h> | |
25 | #include <ubik.h> | |
26 | ||
27 | #define ERRCODE_RANGE 8 /* from error_table.h */ | |
28 | ||
29 | #include "AFS_component_version_number.c" | |
30 | ||
31 | int | |
32 | main(int argc, char *argv[]) | |
33 | { | |
34 | int i; | |
35 | afs_int32 code; | |
36 | afs_int32 offset; | |
37 | char msgbuf[BUFSIZ]; | |
38 | ||
39 | #ifdef AFS_AIX32_ENV | |
40 | /* | |
41 | * The following signal action for AIX is necessary so that in case of a | |
42 | * crash (i.e. core is generated) we can include the user's data section | |
43 | * in the core dump. Unfortunately, by default, only a partial core is | |
44 | * generated which, in many cases, isn't too useful. | |
45 | */ | |
46 | struct sigaction nsa; | |
47 | ||
48 | sigemptyset(&nsa.sa_mask); | |
49 | nsa.sa_handler = SIG_DFL; | |
50 | nsa.sa_flags = SA_FULLDUMP; | |
51 | sigaction(SIGSEGV, &nsa, NULL); | |
52 | #endif | |
53 | initialize_KA_error_table(); | |
54 | initialize_RXK_error_table(); | |
55 | initialize_KTC_error_table(); | |
56 | initialize_ACFG_error_table(); | |
57 | initialize_CMD_error_table(); | |
58 | initialize_VL_error_table(); | |
59 | initialize_PT_error_table(); | |
60 | initialize_BZ_error_table(); | |
61 | initialize_U_error_table(); | |
62 | initialize_VOLS_error_table(); | |
63 | ||
64 | if (argc < 2) { | |
65 | fprintf(stderr, "Usage is: %s [<code>]+\n", argv[0]); | |
66 | exit(1); | |
67 | } | |
68 | ||
69 | for (i = 1; i < argc; i++) { | |
70 | code = atoi(argv[i]); | |
71 | offset = code & ((1 << ERRCODE_RANGE) - 1); | |
72 | ||
73 | printf("%d (%s).%d = %s\n", (int)code, afs_error_table_name(code), | |
74 | (int)offset, afs_error_message_localize(code, msgbuf, BUFSIZ)); | |
75 | } | |
76 | return 0; | |
77 | } |