Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c01226c3 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Sam Ravnborg
Browse files

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: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
parent 17c5ca98
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -659,6 +659,12 @@ extern int do_sysinfo(struct sysinfo *info);

#endif /* __KERNEL__ */

#ifndef __EXPORTED_HEADERS__
#ifndef __KERNEL__
#warning Attempt to use kernel headers from user space, see http://kernelnewbies.org/KernelHeaders
#endif /* __KERNEL__ */
#endif /* __EXPORTED_HEADERS__ */

#define SI_LOAD_SHIFT	16
struct sysinfo {
	long uptime;			/* Seconds since boot */
+1 −1
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ use strict;

my ($readdir, $installdir, $arch, @files) = @ARGV;

my $unifdef = "scripts/unifdef -U__KERNEL__";
my $unifdef = "scripts/unifdef -U__KERNEL__ -D__EXPORTED_HEADERS__";

foreach my $file (@files) {
	local *INFILE;