Browse code

core: futexlock include hack for older futex.h

Older non-fixed linux/futex.h version (<2.6.20) cannot be included from
userspace without additional type declarations (which otherwise
are included only if __KERNEL__ is defined).
Note that most distribution fix this problem by distributing a
modified /usr/include/linux/futex.h and not the default kernel
one. However there are other distributions (like CentOS 5) for
which this hack is needed.

Andrei Pelinescu-Onciul authored on 16/07/2009 12:05:50
Showing 1 changed files
... ...
@@ -49,6 +49,12 @@
49 49
                           between linux-libc-dev andlibc headers
50 50
                           in recent (6.08.2008) x86_64 debian sid
51 51
                           installations */
52
+/* hack to work with old linux/futex.h versions, that depend on sched.h in
53
+   __KERNEL__ mode (futex.h < 2.6.20) */
54
+#include <linux/types.h>
55
+typedef __u32 u32;
56
+struct task_struct;
57
+/* end of the hack */
52 58
 #include <linux/futex.h>
53 59
 #include <sys/syscall.h>
54 60
 #include <unistd.h>