[haiku-development] Re: [haiku-development] src_libs_compat_freebsd_network_compat_sys_param.h.diff

  • From: "François Revol" <revol@xxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Wed, 28 May 2008 17:56:04 +0200 CEST

>
> On 2008-05-28 at 15:52:05 [+0200], François Revol <revol@xxxxxxx>
> wrote:
> > > "François Revol" <revol@xxxxxxx> wrote:
> > > > I added it to limits.h, as it's supposed to be available there,
> > > > but
> > > > it
> > > > should really be arch-dependant, and set from B_PAGE_SIZE, so
> > > > from
> > > > another include, but I'm not sure we are allowed to include
> > > > OS.h
> > > > from
> > > > there.
> > > > Ingo ?
> > >
> > > B_PAGE_SIZE should be defined in some arch header as well,
> > > actually.
> > > And no, we don't want to mix POSIX with our headers too much.
> >
> > Be used things like posix/be_errors.h and friends in Dano to have
> > common stuff that are included in both posix and native headers...
> > That still doesn't handle the arch specific stuff.
> > Linux has headers including stuff from asm/
>
> We have posix/arch/..., and I agree with Axel to rather add an
> arch-specific limits.h there. <OS.h> should simply include <limits.h>
> and
> define B_PAGE_SIZE to PAGE_SIZE or PAGESIZE.

+1.

>
> Regarding error codes, the cleanest solution would be to put the
> POSIX
> error codes in <errno.h> and include that from <Errors.h>, so that Be
> API
> definitions don't pollute the POSIX namespace. This is somewhat ugly
> though, due to the way some POSIX error codes are defined ATM
> (synonymous
> to Be error codes).

It's still less ugly, and it's still logical anyway, we define POSIX
errors as a subset of system errors, it's normal to define them from
the later.

François.

Other related posts: