diff options
| author | Benjamin Berg <benjamin.berg@intel.com> | 2025-09-24 16:20:58 +0200 |
|---|---|---|
| committer | Thomas Weißschuh <linux@weissschuh.net> | 2026-01-04 10:28:44 +0100 |
| commit | ec4bb8e8dfa060c699b548f62e4d56133aafbbec (patch) | |
| tree | ecfe6b0f86696972718ced89f65fdff5dea48c73 /tools/testing | |
| parent | 8f0b4cce4481fb22653697cced8d0d04027cb1e8 (diff) | |
tools/nolibc: add ptrace support
Add ptrace support, as it will be useful in UML.
Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
[Thomas: drop va_args usage and linux/uio.h inclusion]
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Diffstat (limited to 'tools/testing')
| -rw-r--r-- | tools/testing/selftests/nolibc/nolibc-test.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/testing/selftests/nolibc/nolibc-test.c b/tools/testing/selftests/nolibc/nolibc-test.c index 3c5a226dad3a..6888b20af259 100644 --- a/tools/testing/selftests/nolibc/nolibc-test.c +++ b/tools/testing/selftests/nolibc/nolibc-test.c @@ -17,6 +17,7 @@ #include <sys/mman.h> #include <sys/mount.h> #include <sys/prctl.h> +#include <sys/ptrace.h> #include <sys/random.h> #include <sys/reboot.h> #include <sys/resource.h> @@ -1406,6 +1407,7 @@ int run_syscall(int min, int max) CASE_TEST(readv_zero); EXPECT_SYSZR(1, readv(1, NULL, 0)); break; CASE_TEST(writev_badf); EXPECT_SYSER(1, writev(-1, &iov_one, 1), -1, EBADF); break; CASE_TEST(writev_zero); EXPECT_SYSZR(1, writev(1, NULL, 0)); break; + CASE_TEST(ptrace); EXPECT_SYSER(1, ptrace(PTRACE_CONT, getpid(), NULL, NULL), -1, ESRCH); break; CASE_TEST(syscall_noargs); EXPECT_SYSEQ(1, syscall(__NR_getpid), getpid()); break; CASE_TEST(syscall_args); EXPECT_SYSER(1, syscall(__NR_statx, 0, NULL, 0, 0, NULL), -1, EFAULT); break; CASE_TEST(namespace); EXPECT_SYSZR(euid0 && proc, test_namespace()); break; |
