This is an automated email from the ASF dual-hosted git repository. cmcfarlen pushed a commit to branch 10.0.x in repository https://gitbox.apache.org/repos/asf/trafficserver.git
commit 41d5a97a26dc4aa4a133f628198a7e59e72462c3 Author: Yann Kerhervé <[email protected]> AuthorDate: Tue Feb 4 20:40:42 2025 -0800 traffic_crashlog: compile for FreeBSD (#12002) Update calls to conform to FreeBSD's ptrace(2). Note that this depends on deprecated procfs(5) and has not been tested beyond passing the build test. See #12001 (cherry picked from commit 0019d04d3896401fdc38879de5fb37647aeda844) --- src/traffic_crashlog/backtrace.cc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/traffic_crashlog/backtrace.cc b/src/traffic_crashlog/backtrace.cc index 9967909bf5..ab0ae983b3 100644 --- a/src/traffic_crashlog/backtrace.cc +++ b/src/traffic_crashlog/backtrace.cc @@ -37,6 +37,15 @@ #include <string.h> #include <libunwind.h> #include <libunwind-ptrace.h> +#if defined(__FreeBSD__) +#include <sys/types.h> +#define __WALL P_ALL +#define PTRACE_ATTACH PT_ATTACH +#define PTRACE_DETACH PT_DETACH +#define DATA_NULL 0 +#else +#define DATA_NULL NULL +#endif #include <sys/ptrace.h> #include <cxxabi.h> #include <vector> @@ -158,7 +167,7 @@ done: _UPT_destroy(ap); } - status = ptrace(PTRACE_DETACH, target, NULL, NULL); + status = ptrace(PTRACE_DETACH, target, NULL, DATA_NULL); Dbg(dbg_ctl_backtrace, "ptrace(DETACH, %ld) -> %d (errno %d)\n", (long)target, status, errno); } } // namespace
