diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-03-25 05:51:53 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-03-25 05:51:53 -0400 |
| commit | ff85f707ac49ad77b7cf8dcef38e7fcd468ca3d6 (patch) | |
| tree | 886db57888058d507c6a14000cf4dd2b581311e1 /tools/testing/selftests/exec/execveat.c | |
| parent | e9533ae539d5cc3d5fc501529d2df7b77e20449c (diff) | |
| parent | bc465aa9d045feb0e13b4a8f32cc33c1943f62d6 (diff) | |
Merge 4.0-rc5 into char-misc-next
We want those fixes in here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/testing/selftests/exec/execveat.c')
| -rw-r--r-- | tools/testing/selftests/exec/execveat.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tools/testing/selftests/exec/execveat.c b/tools/testing/selftests/exec/execveat.c index e238c9559caf..8d5d1d2ee7c1 100644 --- a/tools/testing/selftests/exec/execveat.c +++ b/tools/testing/selftests/exec/execveat.c | |||
| @@ -30,7 +30,7 @@ static int execveat_(int fd, const char *path, char **argv, char **envp, | |||
| 30 | #ifdef __NR_execveat | 30 | #ifdef __NR_execveat |
| 31 | return syscall(__NR_execveat, fd, path, argv, envp, flags); | 31 | return syscall(__NR_execveat, fd, path, argv, envp, flags); |
| 32 | #else | 32 | #else |
| 33 | errno = -ENOSYS; | 33 | errno = ENOSYS; |
| 34 | return -1; | 34 | return -1; |
| 35 | #endif | 35 | #endif |
| 36 | } | 36 | } |
| @@ -234,6 +234,14 @@ static int run_tests(void) | |||
| 234 | int fd_cloexec = open_or_die("execveat", O_RDONLY|O_CLOEXEC); | 234 | int fd_cloexec = open_or_die("execveat", O_RDONLY|O_CLOEXEC); |
| 235 | int fd_script_cloexec = open_or_die("script", O_RDONLY|O_CLOEXEC); | 235 | int fd_script_cloexec = open_or_die("script", O_RDONLY|O_CLOEXEC); |
| 236 | 236 | ||
| 237 | /* Check if we have execveat at all, and bail early if not */ | ||
| 238 | errno = 0; | ||
| 239 | execveat_(-1, NULL, NULL, NULL, 0); | ||
| 240 | if (errno == ENOSYS) { | ||
| 241 | printf("[FAIL] ENOSYS calling execveat - no kernel support?\n"); | ||
| 242 | return 1; | ||
| 243 | } | ||
| 244 | |||
| 237 | /* Change file position to confirm it doesn't affect anything */ | 245 | /* Change file position to confirm it doesn't affect anything */ |
| 238 | lseek(fd, 10, SEEK_SET); | 246 | lseek(fd, 10, SEEK_SET); |
| 239 | 247 | ||
