[Top][All Lists]

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

Re: errno --> errno name ?

From: Bruce Korb
Subject: Re: errno --> errno name ?
Date: Tue, 02 Aug 2011 16:27:25 -0700
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20110616 SUSE/3.1.11 Thunderbird/3.1.11

Hi Bruno,

On 08/02/11 15:49, Bruno Haible wrote:
Is the list of errno values meant to be extracted before a tarball is built, or
at build time?

Build time -- the script needs to be made portable.
The included Makefile has a dependency.  I included it as an example.

Also, what's the point of using the numeric values of the error numbers?
If you generate code like

For human eyeball reference.  It's all in one place, instead of scattered about 
almost a dozen different files.

then the code is not only more robust but also requires fewer relocations when
put into a shared library. In

     [  1] = "EPERM",
     [  2] = "ENOENT",

the shared library needs to relocate, during loading, as many pointers as there
are references to strings.

It wasn't written for a shared library.  It was written and twiddled exclusively
for command line use.  Still, it isn't rocket science to either emit an array
of offsets into a string with embedded NUL bytes, or to emit the switch
statement you noted above.  The real deal with the code was a mechanism
for finding errno information by number, name or a regular expression searching
of the errno descriptions.

Cheers - Bruce

reply via email to

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