Browse code

core: futexlock compilation workaround for OpenSuse 10.2

In some older linux distributions /usr/include/futex.h uses a __user
attribute, which is defined in linux/compiler.h.
However linux/compiler.h is not part of the kernel headers package in most
recent distributions. Instead they ship a modified linux/futex.h that
does not include <linux/compile.h> and does not use __user.
"__user" is used only for checking pointer address space in the kernel
(using the sparse tool and make C=1 or make C=2) so it's safe to define
it as null/empty.

Reported-by: Alexandr Dubovikov shurik start4 info

Andrei Pelinescu-Onciul authored on 14/06/2010 17:11:59
Showing 1 changed files
... ...
@@ -55,6 +55,16 @@
55 55
 typedef __u32 u32;
56 56
 struct task_struct;
57 57
 /* end of the hack */
58
+/* another hack this time for OpenSuse 10.2:
59
+   futex.h uses a __user attribute, which is defined in linux/compiler.h
60
+   However linux/compiler.h is not part of the kernel headers package in
61
+   most distributions. Instead they ship a modified linux/futex.h that does
62
+   not include <linux/compile.h> and does not user __user.
63
+*/
64
+#ifndef __user
65
+#define __user
66
+#endif /* __user__*/
67
+/* end of hack */
58 68
 #include <linux/futex.h>
59 69
 #include <sys/syscall.h>
60 70
 #include <unistd.h>