diff options
-rw-r--r-- | devel/compdbgen/Makefile | 6 | ||||
-rw-r--r-- | devel/compdbgen/files/extra-patch-mainloop.c | 35 |
2 files changed, 41 insertions, 0 deletions
diff --git a/devel/compdbgen/Makefile b/devel/compdbgen/Makefile index 9d4717eedd7e..fad3099fd807 100644 --- a/devel/compdbgen/Makefile +++ b/devel/compdbgen/Makefile @@ -22,4 +22,10 @@ do-build: do-install: ${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin +.include <bsd.port.options.mk> + +.if ${OPSYS} == FreeBSD && ${OSVERSION} < 1400000 +EXTRA_PATCHES= ${PATCHDIR}/extra-patch-mainloop.c +.endif + .include <bsd.port.mk> diff --git a/devel/compdbgen/files/extra-patch-mainloop.c b/devel/compdbgen/files/extra-patch-mainloop.c new file mode 100644 index 000000000000..33a01eecebac --- /dev/null +++ b/devel/compdbgen/files/extra-patch-mainloop.c @@ -0,0 +1,35 @@ +--- mainloop.c.orig 2025-09-11 04:56:11 UTC ++++ mainloop.c +@@ -433,20 +433,32 @@ static void enter_syscall(struct glbctx *info, struct + static int json_item_cnt = 0; + struct syscall *sc; + u_int i, narg; ++#if defined(__FreeBSD_version) && __FreeBSD_version < 1400000 ++ register_t *args; ++#else + syscallarg_t *args; ++#endif + + /* ignore other syscall except execve */ + if (pl->pl_syscall_code != SYS_execve) { + return; + } + ++#if defined(__FreeBSD_version) && __FreeBSD_version < 1400000 ++ args = calloc(pl->pl_syscall_narg, sizeof(register_t)); ++#else + args = calloc(pl->pl_syscall_narg, sizeof(syscallarg_t)); ++#endif + if (args == NULL) { + err(1, "malloc syscall args failed\n"); + } + + if (ptrace(PT_GET_SC_ARGS, t->tid, (caddr_t)args, ++#if defined(__FreeBSD_version) && __FreeBSD_version < 1400000 ++ sizeof(register_t) * pl->pl_syscall_narg) != 0) { ++#else + sizeof(syscallarg_t) * pl->pl_syscall_narg) != 0) { ++#endif + goto _EXIT; + } + |