Вообщем решил в целях повышения образованности почитать ldd. Прочёв
первую часть, перешёл ко второй, где был самый простой модуль.
$ cat hello.c
#define MODULE
#include <linux/module.h>
int init_module(void)
{
printk("Hello, world\n");
return 0;
}
void cleanup_module(void)
{
printk("Goodbye cruel world\n");
}
Но вот собрать его не получилось:
$ gcc -Wall -DLINUX -c hello.c
In file included from /usr/include/asm/cputime.h:4,
from /usr/include/linux/sched.h:23,
from /usr/include/linux/module.h:10,
from hello.c:2:
/usr/include/asm-generic/cputime.h:21: error: parse error before "cputime64_t"
In file included from /usr/include/asm/siginfo.h:4,
from /usr/include/linux/signal.h:7,
from /usr/include/linux/sched.h:27,
from /usr/include/linux/module.h:10,
from hello.c:2:
/usr/include/asm-generic/siginfo.h:61: error: size of array `_pad' is too large
In file included from hello.c:2:
/usr/include/linux/module.h:50: error: field `attr' has incomplete type
/usr/include/linux/module.h:58: error: field `kobj' has incomplete type
/usr/include/linux/module.h:233: error: field `grp' has incomplete type
Пробовал без -DLINUX, результат такой же.
Вот собсно и вопрос что делать, и что не так?
Заранее спасибо!!!