Prechádzať zdrojové kódy

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 15 rokov pred
rodič
commit
291166681c
1 zmenil súbory, kde vykonal 10 pridanie a 0 odobranie
  1. 10 0
      futexlock.h

+ 10 - 0
futexlock.h

@@ -55,6 +55,16 @@
 typedef __u32 u32;
 typedef __u32 u32;
 struct task_struct;
 struct task_struct;
 /* end of the hack */
 /* end of the hack */
+/* another hack this time for OpenSuse 10.2:
+   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 distributions. Instead they ship a modified linux/futex.h that does
+   not include <linux/compile.h> and does not user __user.
+*/
+#ifndef __user
+#define __user
+#endif /* __user__*/
+/* end of hack */
 #include <linux/futex.h>
 #include <linux/futex.h>
 #include <sys/syscall.h>
 #include <sys/syscall.h>
 #include <unistd.h>
 #include <unistd.h>