diff options
author | Arnd Bergmann <arnd@arndb.de> | 2009-09-21 10:37:12 -0400 |
---|---|---|
committer | Sam Ravnborg <sam@ravnborg.org> | 2009-10-11 17:21:25 -0400 |
commit | c01226c3145d173a0d38f9d5b4f229cc23d99ae2 (patch) | |
tree | 7f0eb41f9da3b412115694752d07cb85bb707bdb /include | |
parent | 17c5ca98833dc3d8f8dd4e85487da238c50cd8c9 (diff) |
warn about use of uninstalled kernel headers
User applications frequently hit problems when they try to use
the kernel headers directly, rather than the exported headers.
This adds an explicit warning for this case, and points to
a URL holding an explanation of why this is wrong and what
to do about it.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/kernel.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index d3cd23f30039..f4e3184fa054 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -659,6 +659,12 @@ extern int do_sysinfo(struct sysinfo *info); | |||
659 | 659 | ||
660 | #endif /* __KERNEL__ */ | 660 | #endif /* __KERNEL__ */ |
661 | 661 | ||
662 | #ifndef __EXPORTED_HEADERS__ | ||
663 | #ifndef __KERNEL__ | ||
664 | #warning Attempt to use kernel headers from user space, see http://kernelnewbies.org/KernelHeaders | ||
665 | #endif /* __KERNEL__ */ | ||
666 | #endif /* __EXPORTED_HEADERS__ */ | ||
667 | |||
662 | #define SI_LOAD_SHIFT 16 | 668 | #define SI_LOAD_SHIFT 16 |
663 | struct sysinfo { | 669 | struct sysinfo { |
664 | long uptime; /* Seconds since boot */ | 670 | long uptime; /* Seconds since boot */ |