Both are damn bad, especially as I am not working solely on Linux systems,
but on all platforms that I work on, I very likely have to plunge deep
into the system core.
For ages I have maintained a complex MTA software which contains also
IPv6 support as a standard (configurable) feature.
I used to run libc5, and now glibc-2.0. (IPv6 application without glibc-2.1!)
(But the system compiles also on Solaris, DEC UNIX, *BSD, ...)
I do the thing WITHOUT libinet6, or any such external crutches, because
those too assume something which too often is not true. Usually their
associated include files blow up rather spectacularly..
(It means my package must contain bits of libinet6 just in case the
system libc does not supply the thing..)
I have a lenghty autoconfig test sequence to analyze the environment,
and to determine which headers to include. If <netinet/in.h> is all
that I need, no others will be looked for, otherwise:
#include <sys/socket.h>
#include <netinet/in.h>
#ifdef HAVE_NETINET_IN6_H
# include <netinet/in6.h>
#endif
#ifdef HAVE_NETINET6_IN6_H
# include <netinet6/in6.h>
#endif
#ifdef HAVE_LINUX_IN6_H
# include <linux/in6.h>
#endif
#include <netdb.h>
#ifndef EAI_AGAIN
# include "netdb6.h"
#endif
However, every instance of glibc-2.0 I have upgraded to has required one
post-install fix to its /usr/include/socketbits.h file, which does a define
controlling inclusion of <linux/types.h> without ever including that file:
#ifndef _LINUX_TYPES_H
# define _LINUX_TYPES_H
#endif
#include <asm/socket.h>
I leave it as an excercise for you to find a way to do this so that
it will not break parallel inclusion of things which do require
including <linux/types.h>
(I have heaps of this type of fixes, but I have not been able to
find reliable ways to feed those fixes back to the base sources :-( )
> (.. add cases here I haven't considered ...)
> This is the answer a lot of us are looking for.
>
> Later,
> David S. Miller
> davem@dm.cobaltmicro.com
/Matti Aarnio <matti.aarnio@sonera.fi> <mea@nic.funet.fi>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu