bug-gnulib
[Top][All Lists]
Advanced

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

Re: errno --> errno name ?


From: Bruno Haible
Subject: Re: errno --> errno name ?
Date: Mon, 6 Jun 2011 22:52:14 +0200
User-agent: KMail/1.9.9

Hi Sam, all,

> 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.

Good point. The code for doing this is already present in clisp/src/errunix.d
and strace/**/errnoent.h.

Question to all: Are you interested in seeing such a function in gnulib?

Question to Sam: Are you willing to contribute such a module to gnulib
(and maintain it)?

Bruno
-- 
In memoriam Robert F. Kennedy <http://en.wikipedia.org/wiki/Robert_F._Kennedy>



reply via email to

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