--- ./tests/util/dirent.c_orig	2023-04-19 08:18:38.931466792 +0000
+++ ./tests/util/dirent.c	2023-04-19 08:21:42.386598314 +0000
@@ -209,12 +209,14 @@
 	check_counts(&odd);
 }
 
+/* AIX FILENAME_MAX is 255 which does not return error at open() */
+#define Linux_FILENAME_MAX 4096
 /* test filename length limits */
 void test_dirent__length_limits(void)
 {
-	char *big_filename = (char *)git__malloc(FILENAME_MAX + 1);
-	memset(big_filename, 'a', FILENAME_MAX + 1);
-	big_filename[FILENAME_MAX] = 0;
+	char *big_filename = (char *)git__malloc(Linux_FILENAME_MAX + 1);
+	memset(big_filename, 'a', Linux_FILENAME_MAX + 1);
+	big_filename[Linux_FILENAME_MAX] = 0;
 
 	cl_must_fail(p_creat(big_filename, 0666));
 
--- ./tests/libgit2/repo/discover.c_orig	2023-04-19 08:48:22.840063594 +0000
+++ ./tests/libgit2/repo/discover.c	2023-04-19 08:51:33.830787397 +0000
@@ -31,7 +31,14 @@
 	git_buf found_path = GIT_BUF_INIT;
 	git_str resolved = GIT_STR_INIT;
 
+#ifdef _AIX61
+       char *PN;
+       PN = malloc(PATH_MAX * 10);
+       git_str_attach(&resolved, p_realpath(expected_path, PN), 0);
+#else
 	git_str_attach(&resolved, p_realpath(expected_path, NULL), 0);
+#endif
+
 	cl_assert(resolved.size > 0);
 	cl_git_pass(git_fs_path_to_dir(&resolved));
 	cl_git_pass(git_repository_discover(&found_path, start_path, 1, ceiling_dirs));
--- ./tests/libgit2/config/conditionals.c.orig	2023-04-20 07:48:40.170937571 +0000
+++ ./tests/libgit2/config/conditionals.c	2023-04-20 07:50:43.047058692 +0000
@@ -52,7 +52,14 @@
 
 static char *sandbox_path(git_str *buf, const char *suffix)
 {
+#ifdef _AIX61
+       /* char PN[PATH_MAX];  leads to error no memeory later on */
+       char *PN;
+       PN = malloc(PATH_MAX * 10);
+       char *path = p_realpath(clar_sandbox_path(), PN);
+#else
 	char *path = p_realpath(clar_sandbox_path(), NULL);
+#endif
 	cl_assert(path);
 	cl_git_pass(git_str_attach(buf, path, 0));
 	cl_git_pass(git_str_joinpath(buf, buf->ptr, suffix));
