On 12/6/06, saurabh jain <[EMAIL PROTECTED]> wrote:
Hi,
I was trying to compile a simple prog....
/* snippet */
#define MODULE
#include <signal.h>
#include <linux/module.h>
int init_module (void) /* Loads a module in the kernel */
{
printk("Loading module \n");
return 0;
}
void cleanup_module(void) /* Removes module from kernel */
{
printk("Unloaded waste module \n");
}
/* End Code*/
When I try to compile this with gcc -c filename.c
I get following errors.....
/usr/include/linux/time.h:9: error: redefinition of 'struct timespec'
/usr/include/linux/time.h:15: error: redefinition of 'struct timeval'
/usr/include/linux/time.h:20: error: redefinition of 'struct timezone'
/usr/include/linux/time.h:47: error: redefinition of 'struct itimerval'
In file included from filename.c :3:
/usr/include/linux/module.h:41: error: field 'attr' has incomplete type
/usr/include/linux/module.h:49: error: field 'kobj' has incomplete type
I think there are some additional defines missing, and your compile command
may not be correct... I'm no expert in this, though. Have you looked at
this:
http://tldp.org/LDP/lkmpg/index.html
(Tutorials are based on your kernel version)
--
------------------------------------------------------------
"In the rhythm of music a secret is hidden;
If I were to divulge it, it would overturn the world."
-- Jelaleddin Rumi