|
@@ -9,6 +9,8 @@
|
|
#include <stdbool.h>
|
|
#include <stdbool.h>
|
|
#include "mlock2.h"
|
|
#include "mlock2.h"
|
|
|
|
|
|
|
|
+#include "../kselftest.h"
|
|
|
|
+
|
|
struct vm_boundaries {
|
|
struct vm_boundaries {
|
|
unsigned long start;
|
|
unsigned long start;
|
|
unsigned long end;
|
|
unsigned long end;
|
|
@@ -303,7 +305,7 @@ static int test_mlock_lock()
|
|
if (mlock2_(map, 2 * page_size, 0)) {
|
|
if (mlock2_(map, 2 * page_size, 0)) {
|
|
if (errno == ENOSYS) {
|
|
if (errno == ENOSYS) {
|
|
printf("Cannot call new mlock family, skipping test\n");
|
|
printf("Cannot call new mlock family, skipping test\n");
|
|
- _exit(0);
|
|
|
|
|
|
+ _exit(KSFT_SKIP);
|
|
}
|
|
}
|
|
perror("mlock2(0)");
|
|
perror("mlock2(0)");
|
|
goto unmap;
|
|
goto unmap;
|
|
@@ -412,7 +414,7 @@ static int test_mlock_onfault()
|
|
if (mlock2_(map, 2 * page_size, MLOCK_ONFAULT)) {
|
|
if (mlock2_(map, 2 * page_size, MLOCK_ONFAULT)) {
|
|
if (errno == ENOSYS) {
|
|
if (errno == ENOSYS) {
|
|
printf("Cannot call new mlock family, skipping test\n");
|
|
printf("Cannot call new mlock family, skipping test\n");
|
|
- _exit(0);
|
|
|
|
|
|
+ _exit(KSFT_SKIP);
|
|
}
|
|
}
|
|
perror("mlock2(MLOCK_ONFAULT)");
|
|
perror("mlock2(MLOCK_ONFAULT)");
|
|
goto unmap;
|
|
goto unmap;
|
|
@@ -425,7 +427,7 @@ static int test_mlock_onfault()
|
|
if (munlock(map, 2 * page_size)) {
|
|
if (munlock(map, 2 * page_size)) {
|
|
if (errno == ENOSYS) {
|
|
if (errno == ENOSYS) {
|
|
printf("Cannot call new mlock family, skipping test\n");
|
|
printf("Cannot call new mlock family, skipping test\n");
|
|
- _exit(0);
|
|
|
|
|
|
+ _exit(KSFT_SKIP);
|
|
}
|
|
}
|
|
perror("munlock()");
|
|
perror("munlock()");
|
|
goto unmap;
|
|
goto unmap;
|
|
@@ -457,7 +459,7 @@ static int test_lock_onfault_of_present()
|
|
if (mlock2_(map, 2 * page_size, MLOCK_ONFAULT)) {
|
|
if (mlock2_(map, 2 * page_size, MLOCK_ONFAULT)) {
|
|
if (errno == ENOSYS) {
|
|
if (errno == ENOSYS) {
|
|
printf("Cannot call new mlock family, skipping test\n");
|
|
printf("Cannot call new mlock family, skipping test\n");
|
|
- _exit(0);
|
|
|
|
|
|
+ _exit(KSFT_SKIP);
|
|
}
|
|
}
|
|
perror("mlock2(MLOCK_ONFAULT)");
|
|
perror("mlock2(MLOCK_ONFAULT)");
|
|
goto unmap;
|
|
goto unmap;
|
|
@@ -583,7 +585,7 @@ static int test_vma_management(bool call_mlock)
|
|
if (call_mlock && mlock2_(map, 3 * page_size, MLOCK_ONFAULT)) {
|
|
if (call_mlock && mlock2_(map, 3 * page_size, MLOCK_ONFAULT)) {
|
|
if (errno == ENOSYS) {
|
|
if (errno == ENOSYS) {
|
|
printf("Cannot call new mlock family, skipping test\n");
|
|
printf("Cannot call new mlock family, skipping test\n");
|
|
- _exit(0);
|
|
|
|
|
|
+ _exit(KSFT_SKIP);
|
|
}
|
|
}
|
|
perror("mlock(ONFAULT)\n");
|
|
perror("mlock(ONFAULT)\n");
|
|
goto out;
|
|
goto out;
|