Re: Redefinition error while compiling LKM

From: Arjan van de Ven
Date: Thu Dec 29 2005 - 06:01:00 EST


On Thu, 2005-12-29 at 16:21 +0530, pretorious . wrote:
> 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

this is broken btw
>
> #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>


you cannot use glibc headers in kernel modules. anything in sys/ is a
glibc header.

and.. why on earth would you need sys/syscall.h ?? (or sys/stat.h for
that matter)


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/