errno

Denis Coskun dcoskun at alias.com
Thu Jun 20 07:56:54 AEST 1991


In <17138 at darkstar.ucsc.edu> jik at cats.ucsc.edu (Jonathan I. Kamens) writes:
> Sys_nerr records the number of elements in the sys_errlist array,
> which means the highest valid index in the array is sys_nerr-1,
> and the lowest is 0.

While I agree that this makes sense, is this really established practice
or standardized?  I ask because SGIs (Irix 3.3.2) have messages for indices
0 through sys_nerr.  This program,

   #include <stdio.h>
   #include <errno.h>
   extern int sys_nerr;
   extern char *sys_errlist[];

   main()
   {
       printf("ENFSREMOTE = %d\n", ENFSREMOTE);
       printf("sys_nerr   = %d\n", sys_nerr);
       printf("sys_errlist[sys_nerr] = `%s'\n", sys_errlist[sys_nerr]);
   }

gives the following output:

   ENFSREMOTE = 135
   sys_nerr   = 135
   sys_errlist[sys_nerr] = `Too many levels of remote in path'

--
Denis Coskun    Alias Research Inc. Toronto Canada    dcoskun at alias.com



More information about the Comp.unix.questions mailing list