diff options
Diffstat (limited to 'tools/testing/selftests/exec')
| -rw-r--r-- | tools/testing/selftests/exec/check-exec.c | 13 | ||||
| -rw-r--r-- | tools/testing/selftests/exec/execveat.c | 2 | ||||
| -rw-r--r-- | tools/testing/selftests/exec/load_address.c | 2 | ||||
| -rw-r--r-- | tools/testing/selftests/exec/non-regular.c | 2 | ||||
| -rw-r--r-- | tools/testing/selftests/exec/null-argv.c | 2 | ||||
| -rw-r--r-- | tools/testing/selftests/exec/recursion-depth.c | 2 |
6 files changed, 15 insertions, 8 deletions
diff --git a/tools/testing/selftests/exec/check-exec.c b/tools/testing/selftests/exec/check-exec.c index 4d3f4525e1e1..f2397e75aa7c 100644 --- a/tools/testing/selftests/exec/check-exec.c +++ b/tools/testing/selftests/exec/check-exec.c @@ -22,6 +22,7 @@ #include <sys/prctl.h> #include <sys/socket.h> #include <sys/stat.h> +#include <sys/syscall.h> #include <sys/sysmacros.h> #include <unistd.h> @@ -29,7 +30,13 @@ #define _ASM_GENERIC_FCNTL_H #include <linux/fcntl.h> -#include "../kselftest_harness.h" +#include "kselftest_harness.h" + +static int sys_execveat(int dirfd, const char *pathname, char *const argv[], + char *const envp[], int flags) +{ + return syscall(__NR_execveat, dirfd, pathname, argv, envp, flags); +} static void drop_privileges(struct __test_metadata *const _metadata) { @@ -219,8 +226,8 @@ static void test_exec_fd(struct __test_metadata *_metadata, const int fd, * test framework as an error. With AT_EXECVE_CHECK, we only check a * potential successful execution. */ - access_ret = - execveat(fd, "", argv, NULL, AT_EMPTY_PATH | AT_EXECVE_CHECK); + access_ret = sys_execveat(fd, "", argv, NULL, + AT_EMPTY_PATH | AT_EXECVE_CHECK); access_errno = errno; if (err_code) { EXPECT_EQ(-1, access_ret); diff --git a/tools/testing/selftests/exec/execveat.c b/tools/testing/selftests/exec/execveat.c index 8fb7395fd35b..d37c068ed5fe 100644 --- a/tools/testing/selftests/exec/execveat.c +++ b/tools/testing/selftests/exec/execveat.c @@ -21,7 +21,7 @@ #include <string.h> #include <unistd.h> -#include "../kselftest.h" +#include "kselftest.h" #define TESTS_EXPECTED 54 #define TEST_NAME_LEN (PATH_MAX * 4) diff --git a/tools/testing/selftests/exec/load_address.c b/tools/testing/selftests/exec/load_address.c index 8257fddba8c8..55fd3732f029 100644 --- a/tools/testing/selftests/exec/load_address.c +++ b/tools/testing/selftests/exec/load_address.c @@ -6,7 +6,7 @@ #include <stdio.h> #include <stdlib.h> #include <stdbool.h> -#include "../kselftest.h" +#include "kselftest.h" struct Statistics { unsigned long long load_address; diff --git a/tools/testing/selftests/exec/non-regular.c b/tools/testing/selftests/exec/non-regular.c index cd3a34aca93e..14ac36487df5 100644 --- a/tools/testing/selftests/exec/non-regular.c +++ b/tools/testing/selftests/exec/non-regular.c @@ -9,7 +9,7 @@ #include <sys/sysmacros.h> #include <sys/types.h> -#include "../kselftest_harness.h" +#include "kselftest_harness.h" /* Remove a file, ignoring the result if it didn't exist. */ void rm(struct __test_metadata *_metadata, const char *pathname, diff --git a/tools/testing/selftests/exec/null-argv.c b/tools/testing/selftests/exec/null-argv.c index c19726e710d1..4940aee5bb38 100644 --- a/tools/testing/selftests/exec/null-argv.c +++ b/tools/testing/selftests/exec/null-argv.c @@ -5,7 +5,7 @@ #include <sys/types.h> #include <sys/wait.h> -#include "../kselftest.h" +#include "kselftest.h" #define FORK(exec) \ do { \ diff --git a/tools/testing/selftests/exec/recursion-depth.c b/tools/testing/selftests/exec/recursion-depth.c index 438c8ff2fd26..7b5c4f6d1928 100644 --- a/tools/testing/selftests/exec/recursion-depth.c +++ b/tools/testing/selftests/exec/recursion-depth.c @@ -23,7 +23,7 @@ #include <fcntl.h> #include <sys/mount.h> #include <unistd.h> -#include "../kselftest.h" +#include "kselftest.h" int main(void) { |
