hugemmap32: Check for hugetlbfs availability
PATCH 1/1 hugemmap32: Check for hugetlbfs availability
Trying to open PATH_HUGEPAGE unconditionally will fail if hugepage support is disabled in kernel or not provided by hardware.
Signed-off-by Martin Doucha <[email protected]>
--- testcases/kernel/mem/hugetlb/hugemmap/hugemmap32.c | 3 +++ 1 file changed, 3 insertions(+)
testcases/kernel/mem/hugetlb/hugemmap/hugemmap32.c +3 -0
@@ -47,6 +47,9 @@ static void setup(void)struct dirent *ent;unsigned long hpage_size; +if (access (PATH_HUGEPAGE ,F_OK )) +tst_brk (TCONF ,"hugetlbfs is not supported" ); + dir =SAFE_OPENDIR (PATH_HUGEPAGE );while ((ent =SAFE_READDIR (dir))) { if ((sscanf(ent->d_name, "hugepages-%lukB", &hpage_size) == 1) &&
Signature · 5 lines
2.40.0 -- Mailing list info: https://lists.linux.it/listinfo/ltp
Hi!
Pushed, thanks.
Signature · 5 lines
Cyril Hrubis [email protected] -- Mailing list info: https://lists.linux.it/listinfo/ltp