[PATCH] sys/kd.h should undefine _LINUX_TYPES_H if it set it.

Jeremy Huddleston eradicator@gentoo.org
Mon Mar 7 23:45:00 GMT 2005


On Mon, 2005-03-07 at 09:51 -0800, Ulrich Drepper wrote: 
> Jeremy Huddleston wrote:
> > With linux-2.6.10 headers and glibc-2.3.4, the following code will fail:
> > #include <sys/kd.h>
> > #include <linux/byteorder/big_endian.h>
> 
> You cannot mix kernel headers and libc headers.

This patch causes the same behavior as currently exists in sys/sysctl.h.
This behavior is safe.  Additionally, not doing this causes bigendian
machines to fail compilation of xorg-x11 as
xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_KbdMap.c needs to
pull in linux/keyboard.h which eventually pulls in
linux/byteorder/big_endian.h which pulls in linux/types.h (or rather
doesn't because of the sys/kd.h behavior).  Because it doesn't get
types.h, it doesn't have __le64 defined, so parse fails in big_endian.h.

I don't see an easy way around this for xorg-x11, but there is an easy
way around this in glibc with precedent for this workaround existing in
sys/sysctl.h

--jeremy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20050307/4b717ba9/attachment.sig>


More information about the Libc-alpha mailing list