mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Redefinition error while compiling LKM
@ 2005-12-29 10:51 pretorious .
  2005-12-29 11:00 ` Al Viro
  2005-12-29 11:02 ` Arjan van de Ven
  0 siblings, 2 replies; 8+ messages in thread
From: pretorious . @ 2005-12-29 10:51 UTC (permalink / raw)
  To: linux-kernel

hi!
   I am facing problem in compiling an LKM. It seems Inclusion of 
<sys/stat.h> conflicts with definitions in time.h.


My linux kernal version is 2.4.21-4.EL


#include <linux/kernel.h>
#include <linux/module.h>

#if CONFIG_MODVERSIONS==1
#define MODVERSIONS
#include <linux/modversions.h>
#endif

#ifndef KERNEL_VERSION
#define KERNEL_VERSION(a,b,c) ((a)*65536+(b)*256+(c))
#endif

#include <linux/slab.h>
#include <asm/uaccess.h>
#include <sys/syscall.h>

#include <sys/stat.h>

#define CALLOFF 500
MODULE_LICENSE("GPL");
......
......


Inclusion of header file "sys/stat.h" gives variable redefinition error 
during compilation.

........
In file included from /usr/include/sys/stat.h:37,
                 from venky.c:18:
/usr/include/time.h:119: redefinition of `struct timespec'
In file included from /usr/include/sys/stat.h:105,
                 from venky.c:18:
/usr/include/bits/stat.h:37: redefinition of `struct stat'
......


The Compile string is ::

gcc -O2 -DMODULE -D__KERNEL__ -W -Wall -Wstrict-prototypes 
-Wmissing-prototypes -isystem /lib/modules/`uname -r`/build/include -I../ -c 
-o test.o test.c

Similar redefinition error message are there when trying to include header 
files like sys/types.h

It would be very helpfull if someone would point me in right direction.

Thanks

_________________________________________________________________
Tuff to bluff! Get Abhishek before he gets you! Enter the contest 
http://utv.movie-talkies.com/bluffmaster/contest.html


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2005-12-29 12:16 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-29 10:51 Redefinition error while compiling LKM pretorious .
2005-12-29 11:00 ` Al Viro
2005-12-29 11:02 ` Arjan van de Ven
2005-12-29 11:21   ` pretorious .
2005-12-29 11:46     ` Alexander Shishckin
2005-12-29 11:49     ` Arjan van de Ven
2005-12-29 12:14       ` Alexander Shishckin
2005-12-29 12:16         ` Arjan van de Ven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®