FreeBSD <sys/types.h>

Robert Millan rmh@debian.org
Sat, 11 Dec 2004 15:38:25 +0100


On Sat, Dec 11, 2004 at 02:20:13PM +0100, Nicolas Souchu wrote:
> > 
> > #if defined(__FreeBSD__) || defined(_KERNEL)
> >   code here is used by:
> >     - kernel and userland on FreeBSD
> >     - kernel, but not userland, on GNU/kFreeBSD
> > #endif
> > 
> > Do you think this is acceptable for upstream?
> 
> Looking at your patches and this, I think these solutions which are best for
> the current design are not completly acceptable for upstream.
> I doubt they want to hack the code they've improved during years because a
> GNU project needs it.

Well, for what FreeBSD is concerned any "defined(__FreeBSD__)" check has no
effect at all.  FreeBSD has other checks in kernel and userland that indicate
the code supports (or supported back in time) non-FreeBSD systems, typicaly
NetBSD, OpenBSD or even GNU/Linux (think of kernel drivers).

Well it's not the same importing code into FreeBSD and adding compatibility
chunks than adding compatibility chunks in order to export the code, but we
end up with hacked code in both cases =).

OTOH, GNU projects are known for adapting themselves to other systems when
they pretend to support them.  The typical example is autoconf, and an extreme
one are GCC's fixincludes hack.  I would like to avoid hacking a fixincludes
variant for Glibc for pollitical reasons as long as the technical reasons
suggest to patch kFreeBSD headers, though.

> An acceptable solution will only arrive when the constraint of having glibc
> running on BSD systems will become necessary for both.

Good point.  Do you think having Glibc in ports would help?  I don't know much
FreeBSD (as a project) but I recall seeing programs in ports motivating changes
in src in order to be supported.

> Currently, you have
> to hack both because none has taken this constraint in its design. Both
> are separatly POSIX compatible so applications don't bother.
> 
> So the question is why Debian needs glibc?

Debian doesn't exactly _need_ Glibc.  It just depends on Glibc in the same
way it depends on Linux.  You can replace either Linux or Glibc for anything
you like, but it'll cost you a big load of effort.

There have been efforts at porting Debian to FreeBSD kernel+libc for several
years (first results I'm aware of used FreeBSD 3.x and Debian slink), but they
never had much success.  Since I brought the Glibc-based port to existance,
this project reached much further goals in terms of ported packages or interest
from users/developers than it ever did.  I don't want to go back =).

Even if we can't merge our patches with upstream, maintaining them is an itch
we could live with.  But if we can find a solution that upstream likes, that'd
be much better! ;)

-- 
 .''`.   Proudly running Debian GNU/kFreeBSD unstable/unreleased (on UFS2+S)
: :' :
`. `'    http://www.debian.org/ports/kfreebsd-gnu
  `-