return total;
return sv_2mortal(newSViv(total));
static long mpxs_Apache__RequestRec_read(pTHX_ request_rec *r,                                         SV *bufsv, int len,                                         int offset){    long total;    if (!SvOK(bufsv)) {        sv_setpvn(bufsv, "", 0);    }    if (len <= 0) {        return 0;    }    /* XXX: need to handle negative offset */    /* XXX: need to pad with \0 if offset > size of the buffer */    mpxs_sv_grow(bufsv, len+offset);    total = modperl_request_read(aTHX_ r, SvPVX(bufsv)+offset, len);    if (total > 0) {        mpxs_sv_cur_set(bufsv, offset+total);        SvTAINTED_on(bufsv);    }     else if (total == 0) {        sv_setpvn(bufsv, "", 0);    }    else {        /* need to return undef according to the read entry, but at         * the moment we return IV, so need to change to return SV,         * meanwhile just crock */        if (SvTRUE(ERRSV)) {            (void)modperl_errsv(aTHX_ HTTP_INTERNAL_SERVER_ERROR, r, NULL);        }    }    return total;}