summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorTom Rini <trini@kernel.crashing.org>2004-12-12 16:31:34 -0800
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-12-12 16:31:34 -0800
commit541842f9651aafc7bbdc4ac86a6691e7d57f921a (patch)
tree18e656716e754c8118e008494670ce373260a5cd /include/linux
parent5c6a645429384a300edbe364aed7319a8e5e31b9 (diff)
[PATCH] Add missing __KERNEL__ (or other) protections
As of 2.6.10-rc3, the following is needed to allow various userland packages (sysvinit, dhcp, ppp, libcap, libpcap, lilo) to compile as parts that userland needs (e.g. for ioctls) is in files with stuff userland isn't allowed to see. This adds __KERNEL__ around <linux/ata.h> and some defines (<linux/ata.h> isn't needed by userland, and is unhappy right now). sysvinit and some other packages need <linux/hdreg.h> for HDIO_DRIVE_CMD and other IOCTL things. In <linux/types.h> we were unsafely typedef'ing __le64/__be64 as __u64 only exists when __GNUC__ && !__STRICT_ANSI__ (causing libcap to fail, for example). Finally, <asm/atomic.h> provides routines userland simply cannot use on all arches, but <linux/filter.h> is needed by iputils for example. While not all arches put __KERNEL__ around their header, on MIPS including this header currently blows up the build. Signed-off-by: Tom Rini <trini@kernel.crashing.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/filter.h2
-rw-r--r--include/linux/hdreg.h3
-rw-r--r--include/linux/types.h2
3 files changed, 6 insertions, 1 deletions
diff --git a/include/linux/filter.h b/include/linux/filter.h
index 17218abef8f1..3ba843c46382 100644
--- a/include/linux/filter.h
+++ b/include/linux/filter.h
@@ -8,7 +8,9 @@
#include <linux/compiler.h>
#include <linux/types.h>
+#ifdef __KERNEL__
#include <asm/atomic.h>
+#endif
/*
* Current version of the filter code architecture.
diff --git a/include/linux/hdreg.h b/include/linux/hdreg.h
index c94de12a5ee1..b5d660089de4 100644
--- a/include/linux/hdreg.h
+++ b/include/linux/hdreg.h
@@ -1,6 +1,7 @@
#ifndef _LINUX_HDREG_H
#define _LINUX_HDREG_H
+#ifdef __KERNEL__
#include <linux/ata.h>
/*
@@ -57,7 +58,7 @@
#define IO 0x02
#define REL 0x04
#define TAG_MASK 0xf8
-
+#endif /* __KERNEL__ */
/*
* Command Header sizes for IOCTL commands
diff --git a/include/linux/types.h b/include/linux/types.h
index 893c4b367bae..dcb13f865df9 100644
--- a/include/linux/types.h
+++ b/include/linux/types.h
@@ -157,8 +157,10 @@ typedef __u16 __bitwise __le16;
typedef __u16 __bitwise __be16;
typedef __u32 __bitwise __le32;
typedef __u32 __bitwise __be32;
+#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
typedef __u64 __bitwise __le64;
typedef __u64 __bitwise __be64;
+#endif
struct ustat {
__kernel_daddr_t f_tfree;