--- ./lib/replace/replace.c_orig	2022-09-28 11:39:13 +0000
+++ ./lib/replace/replace.c	2022-09-28 12:16:20 +0000
@@ -32,6 +32,7 @@
 #include "system/syslog.h"
 #include "system/locale.h"
 #include "system/wait.h"
+#include <procinfo.h>
 
 #ifdef _WIN32
 #define mkdir(d,m) _mkdir(d)
@@ -989,6 +990,19 @@
 {
 #ifdef HAVE_PROGRAM_INVOCATION_SHORT_NAME
 	return program_invocation_short_name;
+#elif _AIX
+	if (rep_progname[0] != '\0') {
+		return rep_progname;
+	}
+	char *p = NULL;
+	struct procentry64 procs;
+	pid_t pid = getpid();
+	p = (0 < getprocs64 (&procs, sizeof procs, NULL, 0, &pid, 1)
+		? strdup (procs.pi_comm) : NULL);
+
+	(void)snprintf(rep_progname, sizeof(rep_progname), "%s", p);
+
+	return rep_progname;
 #else /* HAVE_PROGRAM_INVOCATION_SHORT_NAME */
 	FILE *fp = NULL;
 	char cmdline[4096] = {0};
