delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/02/09/02:23:22

Date: Wed, 9 Feb 94 15:59:23 JST
From: Stephen Turnbull <turnbull AT shako DOT sk DOT tsukuba DOT ac DOT jp>
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Cc: support AT qdeck DOT com, pcrowley AT qdeck DOT com
Subject: Revising syserr.c

I *was* thinking about revising syserr.c, but then I looked at errno.h.
    The mechanism for printing error messages supported by the
sys_errlist array of strings is really quite convenient, but as long
as library functions are returning error numbers out of its range it's
going to cause problems.  I was going to revise the list, and it's not
unreasonable to add a couple of strings, but for some reason there are
a bunch of very large error numbers defined:

#define EPIPE   32
#define EDOM    33
#define ERANGE  34
#define EWOULDBLOCK 35
#define EEXIST  36
#define EINTR   100
#define EIO     101
#define ENOSPC  102
#define EAGAIN  103
#define ECHILD  200

I don't know whether it really makes sense to add 180 entries to the
table, all but a dozen of which would be "undefined".  On the other
hand, we can't very well change their values.  It looks like a lot of
the these were probably added by Peter Crowley and others at
Quarterdeck to support DESQview/X-specific extensions.  I suppose that
for most people these are going to be irrelevant, and for those of us
who use the DV/X library we're not going to be able to change it
without the source to the library :-(
    However, for those who would like the mechanism to be a little
more stable, it probably make sense to extend the sys_errlist array in
.../libsrc/c/lib/syserr.c from

char *sys_errlist[] = {

/* lots of entries omitted */

  "no more files"
};

to

char *sys_errlist[] = {

/* lots of entries omitted */

  "no more files",
  "invalid argument",
  "undefined",			/* at least by errno.h */
  "exec format error"
};

    Oh well, so much for a good idea.
    --Steve

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019