[haiku-development] Re: POSIX error code

  • From: Ingo Weinhold <ingo_weinhold@xxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Wed, 21 May 2008 01:42:10 +0200

On 2008-05-21 at 01:05:51 [+0200], kaoutsis <kaoutsis@xxxxxx> wrote:
> Ingo Weinhold wrote:
> > wrote:
> > Anyway, it certainly doesn't harm to try, but I have little hope that this
> > will have any effect. If the standard maintainers consider the request,
> > they are in a dilemma. Undoing the Issue 6 error codes change means that
> > all the applications that relied on it would become non-conforming.
> >
> >   
> I agree.
> I had an idea how to tackle the problem, may be good, may be bad:

The main problem is not binary compatibility. The problem is that the Be API 
requires that error codes be negative. E.g. create_sem() returns a 
non-negative value (the sem_id) when successful, a negative error code 
otherwise. A good deal of other functions/methods use the same strategy, and 
so does third party code. Making our error codes positive will break them all.

Changing concerned API functions to return -1 and set errno would be an 
option, but that would be quite a bit of work and third party software would 
have to be changed as well. Personally I don't even find this option very 
appealing.

CU, Ingo

Other related posts: