/
githubmirror
/
ndctl
Обзор
Документация
Войти
/
githubmirror
/
ndctl
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
test/hugetlb.c
27 строк
608 B
Dan Williams
ndctl, hugetlb: skip, don't fail
10 фев 2018, 08:11
10 фев 2018, 08:11
8834f88
Код
Авторство
О чём код?
#include <stdio.h> #include <errno.h> #include <ccan/array_size/array_size.h> #include <util/size.h> #include <test.h> static int test_hugetlb(void) { int rc, i; unsigned long aligns[] = { SZ_4K, SZ_2M, SZ_1G }; for (i = 0; i < (int) ARRAY_SIZE(aligns); i++) { fprintf(stderr, "%s: page_size: %#lx\n", __func__, aligns[i]); rc = test_dax_directio(-1, aligns[i], NULL, 0); if (rc == -ENOENT && aligns[i] == SZ_1G) continue; /* system not configured for 1G pages */ else if (rc) return 77; } return 0; } int __attribute__((weak)) main(int argc, char *argv[]) { return test_hugetlb(); }