+2001-06-19 Ken Raeburn <raeburn@mit.edu>
+
+ * error_message.c (error_message): Handle some Irix error codes
+ ranging up above sys_nerr, and above 256.
+
+ * test_et.c (main): Test one of the high-numbered Irix system
+ error codes.
+
2001-03-11 Ezra Peisach <epeisach@mit.edu>
* com_err.h: For struct error_table, change the base from an
static int etl_used = 0;
#endif
+#ifndef DEBUG_TABLE_LIST
+#define dprintf(X)
+#else
+#define dprintf(X) printf X
+#endif
+
KRB5_DLLIMP const char FAR * KRB5_CALLCONV
error_message(long code)
/*@modifies internalState@*/
offset = l_offset;
table_num = ((unsigned long)code - l_offset) & ERRCODE_MAX;
if (table_num == 0) {
+ system_error_code:
if (code == 0)
goto oops;
/* This could trip if int is 16 bits. */
- if ((unsigned long)(int)offset != offset)
+ if ((unsigned long)(int)code != code)
abort ();
#ifdef HAVE_STRERROR
- cp = strerror((int) offset);
+ cp = strerror((int) code);
if (cp)
return cp;
goto oops;
#endif /* HAVE_SYS_ERRLIST */
#endif /* HAVE_STRERROR */
}
-
-#ifndef DEBUG_TABLE_LIST
-#define dprintf(X)
-#else
-#define dprintf(X) printf X
+#ifdef __sgi
+ /* Irix 6.5 uses a much bigger table than other UNIX systems
+ I've looked at, but the table is sparse. The sparse
+ entries start around 500, but sys_nerr is only 152. */
+ if (code > 0 && code <= 1600)
+ goto system_error_code;
#endif
dprintf (("scanning static list for %x\n", table_num));
printf("Msg TGT-expired is '%s'\n", error_message(KRB_MK_AP_TGTEXP));
printf("Msg EPERM is '%s'\n", error_message(EPERM));
printf("Msg FOO_ERR is '%s'\n", error_message(FOO_ERR));
+ printf("Msg 1002 is '%s'\n", error_message (1002));
#ifdef HAVE_SYS_ERRLIST
printf("Msg {sys_nerr-1} is '%s'\n", error_message(sys_nerr-1));
printf("Msg {sys_nerr} is '%s'\n", error_message(sys_nerr));