perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <>
Subject Re: [perl #22163] perlio callback functions get their args mangled
Date Mon, 12 May 2003 05:55:19 GMT
[CC'ing modperl dev list, so we have this issue archived]

Nick Ing-Simmons wrote:
> Stas Bekman <> writes:
>>% perl5.8.0 -V | grep Off_t
>>    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', 
>>so perl sees: Off_t='off_t',
>>I've expanded Off_t and it shows:
>>typedef long int __off_t;
>>typedef __off_t off_t;
> I thought "lseeksize" was supposed to be size of off_t?
> Do perl compiles pass any command line -D flags to C compiler 
> that might change expansion of of off_t ?

Thanks Nick.

After confirming that using an explicit 'long long int offset' solves the 
problem (for the given setup):

static IV PerlIOAPR_seek(pTHX_ PerlIO *f, long long int offset, int whence)

I went to figure out where the difference comes from. And then I've found that 
mod_perl rips off the flags '-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64' when 
building mod_perl objects, since Apache 2.0 (to be exact libapr) always builds 
without largefiles support (at least on linux). The two are binary 
incompatible. Sigh :(

Looks like it happens to work for me, if I build only apr_perlio.c with 
'-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', since that's the only place 
where we use Off_t. I don't know whether it'll work on other platforms.

Currently, if you want to use APR::PerlIO's seek function, with offset 
different from 0, you have to rebuild perl without uselargefiles, which is far 
from being an acceptable solution.

Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker     mod_perl Guide --->

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message