Module: sip-router Branch: master Commit: 04938dc72661dfe0c8954f392558812f7aa3da78 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=04938dc7...
Author: Andrei Pelinescu-Onciul andrei@iptel.org Committer: Andrei Pelinescu-Onciul andrei@iptel.org Date: Thu Jul 16 14:05:50 2009 +0200
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.
---
futexlock.h | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/futexlock.h b/futexlock.h index 19e816d..df93b81 100644 --- a/futexlock.h +++ b/futexlock.h @@ -49,6 +49,12 @@ between linux-libc-dev andlibc headers in recent (6.08.2008) x86_64 debian sid 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 <sys/syscall.h> #include <unistd.h>