bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

errno --> errno name ?


From: Sam Steingold
Subject: errno --> errno name ?
Date: Mon, 06 Jun 2011 12:31:22 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

I think it would be a useful addition to the errno/strerror/whatever
modules to be able to convert from the numeric errno to the symbolic
one.
e.g.,

char * errno_name () {
  switch (errno) {
  #ifdef ENOENT
   case ENOENT : return "ENOENT";
  #endif
   default: return NULL;
  }
}

the idea is that the error "explanation" (returned by strerror) is
different on different platforms (and especially if i18n is involved)
and is hard to search for on the web and in docs, while strings like
ENOENT et al are quite canonical and tell the expert everything they
need to know.

I am not proposing replacing strerror, of course; this is merely an
_addition_.

Thanks.

-- 
Sam Steingold (http://sds.podval.org/) on CentOS release 5.6 (Final) X 
11.0.60900031
http://jihadwatch.org http://dhimmi.com http://palestinefacts.org
http://www.PetitionOnline.com/tap12009/ http://thereligionofpeace.com
What was there first: the Compiler or its Source code?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]