diff -up mod_perl-2.0.12/src/modules/perl/modperl_io.c.orig mod_perl-2.0.12/src/modules/perl/modperl_io.c
--- mod_perl-2.0.12/src/modules/perl/modperl_io.c.orig	2023-06-01 12:34:06.696214838 +0200
+++ mod_perl-2.0.12/src/modules/perl/modperl_io.c	2023-06-01 12:33:22.802841353 +0200
@@ -116,8 +116,8 @@ modperl_io_perlio_override_stdhandle(pTH
     save_gp(handle, 1);
 
     sv_setref_pv(sv, "Apache2::RequestRec", (void*)r);
-    status = do_open9(handle, mode == O_RDONLY ? "<:Apache2" : ">:Apache2",
-                      9, FALSE, mode, 0, (PerlIO *)NULL, sv, 1);
+    status = do_openn(handle, mode == O_RDONLY ? "<:Apache2" : ">:Apache2",
+                      9, FALSE, mode, 0, (PerlIO *)NULL, &sv, 1);
     if (status == 0) {
         Perl_croak(aTHX_ "Failed to open STD%s: %" SVf,
                    mode == O_RDONLY ? "IN" : "OUT", get_sv("!", TRUE));
