perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
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 <stas@stason.org> writes:
> 
>>% perl5.8.0 -V | grep Off_t
>>    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', 
>>lseeksize=8
>>
>>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
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Mime
View raw message