[haiku-development] Re: POSIX error code

  • From: "Axel Dörfler" <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Wed, 21 May 2008 13:20:39 +0200 CEST

Andreas Färber <andreas.faerber@xxxxxx> wrote:
> Can't you just return -B_ERROR_CODE, with B_ERROR_CODE positive? :-)

That would still break pretty much all software, besides it's ugly and
error prone (I know Unix does that).

> An error code is not necessarily equivalent to the return code, and
> Posix can't possibly dictate return values of non-Posix APIs. I
> believe I saw some software adding that negation some months ago,
> possibly QEMU.

The only possible solution I see for R2 would be to have the POSIX
error codes positive, and the Be/Haiku error codes negative.
The kernel would then have to use native error codes only, as do any Be
apps. It would still be a porting nightmare (porting *our* own software
to this), but that's the best we can do, I'm afraid (unless they
actually deprecate that part of the standard).

Bye,
   Axel.


Other related posts: