delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/02/09/12:18:43

To: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Re: Revising syserr.c
Organization: Code Generation Technology, San Francisco, CA
Date: Wed, 09 Feb 94 09:12:30 -0800
From: "Thomas J. Merritt" <tjm AT netcom DOT com>

|<><><><><> Original message from dj AT ctron DOT com  <><><><><>
|> 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
|
|You should always compare errno to sys_nerr to determine if the table
|supports that error.

Or better yet, use strerror(3C).  If it is not in the DJGPP C library
by default, it is simple to add.

	char const *
	strerror(int err)
	{
	    if (err < 0 || err >= sys_nerr)
		return "unknown error number";

	    return sys_error[err];
	}

TJ Merritt
tjm AT netcom DOT com
	}
|
|
|

- Raw text -


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