Perl_do_close(aTHX_ handle, TRUE);
MP_INLINE GV *modperl_io_perlio_override_stdout(pTHX_ request_rec *r){    dHANDLE("STDOUT");    int status;    GV *handle_save = gv_fetchpv(Perl_form(aTHX_ "Apache::RequestIO::_GEN_%ld",                                           (long)PL_gensym++),                                 TRUE, SVt_PVIO);    SV *sv = sv_newmortal();    MP_TRACE_o(MP_FUNC, "start");    sv_setref_pv(sv, "Apache::RequestRec", (void*)r);    /* open my $oldout, ">&STDOUT" or die "Can't dup STDOUT: $!"; */    status = Perl_do_open(aTHX_ handle_save, ">&STDOUT", 8, FALSE, O_WRONLY,                          0, Nullfp);    if (status == 0) {        Perl_croak(aTHX_ "Failed to dup STDOUT: %_", get_sv("!", TRUE));    }    /* similar to PerlIO::scalar, the PerlIO::Apache layer doesn't     * have file descriptors, so STDOUT must be closed before it can     * be reopened */    Perl_do_close(aTHX_ handle, TRUE);     status = Perl_do_open9(aTHX_ handle, ">:Apache", 8, FALSE, O_WRONLY,                           0, Nullfp, sv, 1);    if (status == 0) {        Perl_croak(aTHX_ "Failed to open STDOUT: %_", get_sv("!", TRUE));    }    MP_TRACE_o(MP_FUNC, "end\n");    /* XXX: shouldn't we preserve the value STDOUT had before it was     * overridden? */    IoFLUSH_off(handle); /* STDOUT's $|=0 */    return handle_save;    }