git: 8bb41568feee - stable/15 - ptrace_test: require debug.ptrace_transparent_attach enabled for its test

Konstantin Belousov <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.src
Message-ID <6a7d1166.20f1e.2ece0df8__37955.1495470636$1786581387$gmane$org@gitrepo.freebsd.org>
The branch stable/15 has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=8bb41568feee63d8a1e5f161bcada15052068094

commit 8bb41568feee63d8a1e5f161bcada15052068094
Author:     Konstantin Belousov <[email protected]>
AuthorDate: 2026-08-06 21:22:48 +0000
Commit:     Konstantin Belousov <[email protected]>
CommitDate: 2026-08-13 00:34:40 +0000

    ptrace_test: require debug.ptrace_transparent_attach enabled for its test
    
    (cherry picked from commit b0a85cb9df01b1b56bbd530b3c3ae85e6964a9c6)
---
 tests/sys/kern/Makefile      | 1 +
 tests/sys/kern/ptrace_test.c | 4 ++++
 2 files changed, 5 insertions(+)

diff --git a/tests/sys/kern/Makefile b/tests/sys/kern/Makefile
index 2fc9a9b2aca3..b76303d120ba 100644
--- a/tests/sys/kern/Makefile
+++ b/tests/sys/kern/Makefile
@@ -155,6 +155,7 @@ CFLAGS.subr_unit.c+=	-Wno-missing-prototypes
 SRCS.subr_unit_test+=	subr_unit.c
 
 CFLAGS.exterr_test+=	-I${SRCTOP}/tests
+CFLAGS.ptrace_test+=	-I${SRCTOP}/tests
 
 WARNS?=	3
 
diff --git a/tests/sys/kern/ptrace_test.c b/tests/sys/kern/ptrace_test.c
index 478e787d129b..79e0f77a0aa7 100644
--- a/tests/sys/kern/ptrace_test.c
+++ b/tests/sys/kern/ptrace_test.c
@@ -53,6 +53,8 @@
 #include <unistd.h>
 #include <atf-c.h>
 
+#include "freebsd_test_suite/macros.h"
+
 /*
  * Architectures with a user-visible breakpoint().
  */
@@ -4753,6 +4755,8 @@ ATF_TC_BODY(ptrace__PT_ATTACH_no_EINTR, tc)
 	pid_t debuggee;
 	int status;
 
+	ATF_REQUIRE_SYSCTL_INT("debug.ptrace_attach_transparent", 1);
+
 	shm = mmap(NULL, sizeof(*shm), PROT_READ | PROT_WRITE,
 	    MAP_SHARED | MAP_ANON, -1, 0);
 	ATF_REQUIRE(shm != MAP_FAILED);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.