git: b0a85cb9df01 - main - ptrace_test: require debug.ptrace_transparent_attach enabled for its test

Konstantin Belousov <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.src,gmane.os.freebsd.current.scm
Message-ID <[email protected]>
The branch main has been updated by kib:

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

commit b0a85cb9df01b1b56bbd530b3c3ae85e6964a9c6
Author:     Konstantin Belousov <[email protected]>
AuthorDate: 2026-08-06 21:22:48 +0000
Commit:     Konstantin Belousov <[email protected]>
CommitDate: 2026-08-06 23:11:10 +0000

    ptrace_test: require debug.ptrace_transparent_attach enabled for its test
    
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
---
 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 96f1f70a5b08..68d1f800618e 100644
--- a/tests/sys/kern/Makefile
+++ b/tests/sys/kern/Makefile
@@ -156,6 +156,7 @@ SRCS.subr_unit_test+=	subr_unit.c
 CFLAGS.exterr_test+=	-I${SRCTOP}/tests
 CFLAGS.pdwait+=		-I${SRCTOP}/tests
 CFLAGS.procdesc+=	-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 be808a2286d9..4f38f354c1c1 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().
  */
@@ -4752,6 +4754,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.