Kaynağa Gözat

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 16 yıl önce
ebeveyn
işleme
04938dc726
1 değiştirilmiş dosya ile 6 ekleme ve 0 silme
  1. 6 0
      futexlock.h

+ 6 - 0
futexlock.h

@@ -49,6 +49,12 @@
                           between linux-libc-dev andlibc headers
                           between linux-libc-dev andlibc headers
                           in recent (6.08.2008) x86_64 debian sid
                           in recent (6.08.2008) x86_64 debian sid
                           installations */
                           installations */
+/* hack to work with old linux/futex.h versions, that depend on sched.h in
+   __KERNEL__ mode (futex.h < 2.6.20) */
+#include <linux/types.h>
+typedef __u32 u32;
+struct task_struct;
+/* end of the hack */
 #include <linux/futex.h>
 #include <linux/futex.h>
 #include <sys/syscall.h>
 #include <sys/syscall.h>
 #include <unistd.h>
 #include <unistd.h>