Newsgroups: comp.unix.questions
Path: utzoo!utgpu!news-server.csri.toronto.edu!torsqnt!geac!alias!dcoskun
From: dcoskun@alias.com (Denis Coskun)
Subject: Re: errno
Message-ID: <1991Jun19.215654.18120@alias.com>
Sender: news@alias.com (0000-news(0000))
Organization: Alias Research, Inc., Toronto ON Canada
References: <1991Jun15.151924.24619@thunder.mcrcim.mcgill.edu> <2157@mitisft.Convergent.COM> <17138@darkstar.ucsc.edu>
Date: Wed, 19 Jun 1991 21:56:54 GMT

In <17138@darkstar.ucsc.edu> jik@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@alias.com
