On Mon, 6 Sep 2004, Marc Aurele La France wrote:
On Mon, 6 Sep 2004, Michael Lampe wrote:
Marc Aurele La France wrote:

... In both cases, this is a kernel issue.

They will tell you it's not:

/usr/include/linux/list.h:700: warning: #warning "don't include kernel headers in userspace"

Irrelevant. The #include <linux/list.h> is only there in an attempt to resolve the type of the inserted kernel memory list pointer.

I don't know how to handle this properly, though.

Don't assume problems with test kernels need to be resolved here.

You didn't get it. Including linux kernel headers in user space is a no no. See various threads about this on LKML. Bottom line: If you include kernel headers and your app breaks it's your fault not ours.

Leave religion out of this.

1) Xfbdev has always been Linux-specific.
2) Driving /dev/fb* as anything other than a dumb framebuffer isn't possible
  without linux/fb.h's ioctl's.

rc1 is broken WRT this problem. Fix this there.

Now that I have more time to deal with this issue, let's recap/clarify:

I agree with you that asm/ headers should normally not be #include'd by apps. I also think allowing (forcing, in this case) userland to #include <linux/list.h> sets a dangerous precedent.

But this is about 2.6.9-rc1's <linux/fb.h>, a header that provides ioctl's (userland stuff) and therefore disallowing its use from userland is not an option.

It turns out that the fb_monspecs structure modified by rc1 is not ioctl-visible. Thus to fix this problem, it should be sufficient to bracket the fb_manspecs & fb_chroma structure definitions and the #include <linux/list.h> with __KERNEL__, which is what the attached patch against rc1 does. This also deletes a duplicate function declaration in <linux/fb.h>.

I am cc'ing this to those who vouched for the problem change to be included in rc1.

Thanks.

Marc.

+----------------------------------+-----------------------------------+
|  Marc Aurele La France           |  work:   1-780-492-9310           |
|  Computing and Network Services  |  fax:    1-780-492-1729           |
|  352 General Services Building   |  email:  [EMAIL PROTECTED]          |
|  University of Alberta           +-----------------------------------+
|  Edmonton, Alberta               |                                   |
|  T6G 2H1                         |     Standard disclaimers apply    |
|  CANADA                          |                                   |
+----------------------------------+-----------------------------------+
XFree86 developer and VP.  ATI driver and X server internals.

Attachment: fb.diff.gz
Description: Binary data



Reply via email to