Skip to contentSkip to conversation

Fix fb.h breaking compilation of userspace programs

PATCH In review Michal Januszewski 2 participants 2 messages Sep 4, 2004 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix fb.h breaking compilation of userspace programs

Hi,

The latest changes introduced to the fb structs in linux/fb.h make compilation of userspace programs break with:

include/linux/fb.h:305: error: field `modelist' has incomplete type

This is caused by struct list_head not being seen from userspace. The attached patch is a possible fix for this problem.

Live long and prosper.

Signature · 3 lines
Michal 'Spock' Januszewski                        Gentoo Linux Developer
cell: +48504917690                         http://dev.gentoo.org/~spock/
JID: [email protected]               freenode: #gentoo-dev, #gentoo-pl
include/linux/list.h +4 -6
diff -Naur linux-2.6.9-rc1/include/linux/list.h linux-2.6.9-rc1-a/include/linux/list.h
@@ -1,6 +1,10 @@
 #ifndef _LINUX_LIST_H
 #define _LINUX_LIST_H
 
+struct list_head {
+	struct list_head *next, *prev;
+};
+
 #ifdef __KERNEL__
 
 #include <linux/stddef.h>
@@ -25,10 +29,6 @@
  * using the generic single-entry routines.
  */
 
-struct list_head {
-	struct list_head *next, *prev;
-};
-
 #define LIST_HEAD_INIT(name) { &(name), &(name) }
 
 #define LIST_HEAD(name) \
@@ -696,7 +696,5 @@
 		({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \
 	     pos = rcu_dereference(pos->next))
 
-#else
-#warning "don't include kernel headers in userspace"
 #endif /* __KERNEL__ */
 #endif
#1 lore raw
Quoted 9 lines · Michal Januszewski

Hi,

The latest changes introduced to the fb structs in linux/fb.h make compilation of userspace programs break with:

include/linux/fb.h:305: error: field `modelist' has incomplete type

This is caused by struct list_head not being seen from userspace. The attached patch is a possible fix for this problem.

Thanks. Instead of making struct list_head visible to userspace, I'll just move modelist out of struct fb_monspecs.

Tony

-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click