From 588737210d1db00f7e271ea451c26380e43c1ed9 Mon Sep 17 00:00:00 2001 From: Xianyi Zhang Date: Wed, 2 Mar 2011 13:38:32 +0800 Subject: [PATCH] Fixed randomly SEGFAULT when nodemask==NULL with above Linux 2.6.34. Fixed #12. Thank Mr.Ei-ji Nakama providing this patch. --- common_linux.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/common_linux.h b/common_linux.h index d18cd2b72..8b3d44bfa 100644 --- a/common_linux.h +++ b/common_linux.h @@ -68,8 +68,9 @@ extern long int syscall (long int __sysno, ...); static inline int my_mbind(void *addr, unsigned long len, int mode, unsigned long *nodemask, unsigned long maxnode, unsigned flags) { - - return syscall(SYS_mbind, addr, len, mode, nodemask, maxnode, flags); +//Fixed randomly SEGFAULT when nodemask==NULL with above Linux 2.6.34 + unsigned long null_nodemask=0; + return syscall(SYS_mbind, addr, len, mode, &null_nodemask, maxnode, flags); } static inline int my_set_mempolicy(int mode, const unsigned long *addr, unsigned long flag) {