Yannick Lecaillez wrote:
> Hi all,
>
> On Tue, Oct 03, 2006 at 10:19:30AM -0300, Avi Alkalay wrote:
>   
>> My proposition is to map Elektra error codes to POSIX error codes as
>> much as possible in a coherent way, and to use error numbers greater
>> than, say, 1000 for Elektra-specific errors.
>>     
Beware of such assumptions, Avi.
>
> Could you, please, point me main arguments for mapping elektra error
> code to POSIX ? I never understood this point. Why not simply use our
> own errno stored in the KDBHandle struct ?
>   
Two different matters, two answers:

* One, use POSIX errno values for Elektra errors: YES, since then the
standard strerror() (possibly localized) can be used -- no need to waste
effort here

* Two: use Elektra's own errno (stored in the 'handle') vs. the system's
regular errno: so that system calls made inside Elektra won't mess with
its error codes, so that the code is kept re-entrant as much as
possible, so that everything is encapsulated, so that portability to
say, Windows, is still feasible (errno is not writable on Win, since it
is normally mapped to NT's GetLastError() )


Cheers,

    J.L.


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Registry-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/registry-list

Reply via email to