Re: uml fails to compile due to missing offsetof

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 > I fail to see how arch/um/sys-i386/user-offsets.c can compile since
 > offsetof() was declared __KERNEL__ only in include/linux/stddef.h.
 > Does it work for anyone else? If so, is linux/stddef.h or
 > /usr/include/linux/stddef.h used during compilation?
 > The x86_64 variant looks weird as well, linux/stddef.h is appearently
 > included via some other headers.

Yes, the

#include <linux/stddef.h>

looks weird to me.  AFAIK the C standard says that offsetof() comes
from plain old <stddef.h>.  Does the (untested) patch below fix the
build for you?

diff --git a/arch/um/sys-i386/user-offsets.c b/arch/um/sys-i386/user-offsets.c
index 6f4ef2b..447306b 100644
--- a/arch/um/sys-i386/user-offsets.c
+++ b/arch/um/sys-i386/user-offsets.c
@@ -2,7 +2,7 @@ #include <stdio.h>
 #include <signal.h>
 #include <asm/ptrace.h>
 #include <asm/user.h>
-#include <linux/stddef.h>
+#include <stddef.h>
 #include <sys/poll.h>
 
 #define DEFINE(sym, val) \
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux