hi
i am trying to compile the scull device module that is presented in "linux device drivers" (o reilly book)
i first had to make a few changes, because i found out, that instead of accessing the current process's uid and euid by means of current->uid, the current kernel version uses macros like current_uid()
so this made the current->uid error go away
however now, when compiling the module, a file called scull.mod.c is generate, which contains the following stuff:
...
struct module __this_module
__attribute__((section(".gnu.linkonce.this_module"))) = {
.name = KBUILD_MODNAME, //this is line 9
.arch = MODULE_ARCH_INIT,
};
...
then i get a compilation error about the line that starts with ".name":
/home/sancho/ldd/examples/scull/scull.mod.c:9: error: implicit declaration of function ‘KBUILD_STR’
/home/sancho/ldd/examples/scull/scull.mod.c:9: error: ‘scull’ undeclared here (not in a function)
/home/sancho/ldd/examples/scull/scull.mod.c:9: warning: missing braces around initializer
/home/sancho/ldd/examples/scull/scull.mod.c:9: warning: (near initialization for ‘__this_module.name’)
/home/sancho/ldd/examples/scull/scull.mod.c:9: error: initializer element is not constant
/home/sancho/ldd/examples/scull/scull.mod.c:9: error: (near initialization for ‘__this_module.name[0]’)
make[1]: *** [/home/sancho/ldd/examples/scull/scull.mod.o] Error 1
make: *** [modules] Error 2
so it seems, the module build process generates a c file which it later refuses to swallow
whats wrong with this?