Hello, ping. Regards, Guangwen Feng
On 07/07/2015 03:10 PM, Guangwen Feng wrote:: > Compilation failed on RHEL5U11GA because the flag MAP_HUGETLB of > mmap(2) are only available on kernels that are 2.6.32 or higher, > therefore add kernel version check, as well as add mmap.h to > define the flag in order to avoid compilation error. > > Signed-off-by: Guangwen Feng <fenggw-f...@cn.fujitsu.com> > --- > include/lapi/mmap.h | 26 > ++++++++++++++++++++++++++ > testcases/kernel/syscalls/futex/futex_wake04.c | 7 +++++++ > 2 files changed, 33 insertions(+) > create mode 100644 include/lapi/mmap.h > > diff --git a/include/lapi/mmap.h b/include/lapi/mmap.h > new file mode 100644 > index 0000000..e8e5917 > --- /dev/null > +++ b/include/lapi/mmap.h > @@ -0,0 +1,26 @@ > +/* > + * Copyright (c) 2015 Fujitsu Ltd. > + * Author: Guangwen Feng <fenggw-f...@cn.fujitsu.com> > + * > + * This program is free software; you can redistribute it and/or > + * modify it under the terms of the GNU General Public License as > + * published by the Free Software Foundation; either version 2 of > + * the License, or (at your option) any later version. > + * > + * This program is distributed in the hope that it would be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + * GNU General Public License for more details. > + * > + * You should have received a copy of the GNU General Public License > + * along with this program. > + */ > + > +#ifndef __LAPI_MMAP_H__ > +#define __LAPI_MMAP_H__ > + > +#ifndef MAP_HUGETLB > +#define MAP_HUGETLB 0x40000 > +#endif > + > +#endif /* __LAPI_MMAP_H__ */ > diff --git a/testcases/kernel/syscalls/futex/futex_wake04.c > b/testcases/kernel/syscalls/futex/futex_wake04.c > index 955b05e..fa98636 100644 > --- a/testcases/kernel/syscalls/futex/futex_wake04.c > +++ b/testcases/kernel/syscalls/futex/futex_wake04.c > @@ -46,6 +46,7 @@ > #include "safe_macros.h" > #include "futextest.h" > #include "futex_utils.h" > +#include "lapi/mmap.h" > > #define PATH_MEMINFO "/proc/meminfo" > #define PATH_NR_HUGEPAGES "/proc/sys/vm/nr_hugepages" > @@ -62,6 +63,12 @@ static long orig_hugepages; > static void setup(void) > { > tst_require_root(NULL); > + > + if ((tst_kvercmp(2, 6, 32)) < 0) { > + tst_brkm(TCONF, NULL, "This test can only run on kernels " > + "that are 2.6.32 or higher"); > + } > + > tst_tmpdir(); > > SAFE_FILE_SCANF(NULL, PATH_NR_HUGEPAGES, "%ld", &orig_hugepages); > ------------------------------------------------------------------------------ Don't Limit Your Business. Reach for the Cloud. GigeNET's Cloud Solutions provide you with the tools and support that you need to offload your IT needs and focus on growing your business. Configured For All Businesses. Start Your Cloud Today. https://www.gigenetcloud.com/ _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list