Fixed randomly SEGFAULT when nodemask==NULL with above Linux 2.6.34. Fixed #12. Thank Mr.Ei-ji Nakama providing this patch.

This commit is contained in:
Xianyi Zhang 2011-03-02 13:38:32 +08:00
parent cdf33edac3
commit 588737210d
1 changed files with 3 additions and 2 deletions

View File

@ -68,8 +68,9 @@ extern long int syscall (long int __sysno, ...);
static inline int my_mbind(void *addr, unsigned long len, int mode, static inline int my_mbind(void *addr, unsigned long len, int mode,
unsigned long *nodemask, unsigned long maxnode, unsigned long *nodemask, unsigned long maxnode,
unsigned flags) { unsigned flags) {
//Fixed randomly SEGFAULT when nodemask==NULL with above Linux 2.6.34
return syscall(SYS_mbind, addr, len, mode, nodemask, maxnode, flags); 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) { static inline int my_set_mempolicy(int mode, const unsigned long *addr, unsigned long flag) {