[lkml]   [2006]   [Nov]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: uml fails to compile due to missing offsetof
On Sun, Nov 19, 2006 at 01:00:01PM +0100, Olaf Hering wrote:
> 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?

It obviously works for me. offsetof is very standard C. I'd venture
to say that a system which can't find it has a broken gcc installation.

> If so, is linux/stddef.h or /usr/include/linux/stddef.h used during
> compilation?

/usr/include/linux/stddef.h (but see below) - this is a userspace
file, so it builds against libc headers.

> The x86_64 variant looks weird as well, linux/stddef.h is appearently
> included via some other headers.

Well, /usr/include/linux/stddef.h on my x86_64 box has no offsetof,
despite being FC5 just like my i386 laptop. Yay for consistency.

However, there is a /usr/lib/gcc/x86_64-redhat-linux/4.1.1/include/stddef.h
which defines offsetof (and there's a corresponding file on my
laptop), so I bet that's the true source of offsetof.

Work email - jdike at linux dot intel dot com
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2006-11-19 15:31    [W:0.040 / U:0.068 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site