FreeBSD <sys/types.h>

Nicolas Souchu nsouch@free.fr
Fri, 10 Dec 2004 21:50:25 +0100


On Wed, Dec 08, 2004 at 02:37:10AM +0100, Robert Millan wrote:
> 
> Hey, here's a typical problem I just found.   On FreeBSD:
> 
>  * <machine/_types.h> typedef'es intXX_t __foo;
>  * <sys/types.h> typedef'es __foo foo;
> 
> On GNU/kFreeBSD:
> 
>  * <machine/_types.h> typedef'es intXX_t __foo;
>  * <sys/types.h> is provided by Glibc and has no deal with foo.
> 
> How do we get foo in, say, <sys/vm.h> which requires it?  Possible options:
> 
>  * include <machine/_types.h> and use __foo instead.
>  * use intXX_t directly in <sys/vm.h> et al.

A lot of work and differences with original vm.h

>  * patch Glibc to typedef foo in its <sys/types.h>

And you'll have two glibc (Linux and kFBSD) with big differences. Moreover,
what happens if foo; is defined differently in glibc sys/types.h?

>  * include FreeBSD's <sys/types.h> (either by renaming or by using its absolute
>    path), and integrate it with Glibc's to avoid type conflicts.

Or ensure <machine/_types.h> defines foo; but I prefer including FBSD
sys/types.h in glibc types.h

Nicholas