perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: PerlIO::APR: getting the memory pool
Date Thu, 06 Dec 2001 02:42:33 GMT
Doug MacEachern wrote:

> On Thu, 6 Dec 2001, Stas Bekman wrote:
> 
> 
>>but I guess I don't understand something: why do we need to use 
>>APR::File->open? What's wrong with perl's open()? I've it working 
>>already.  If you don't use perl's open() do you also imply that we have 
>>to use $fh->close, $fh->seek and so on, using APR arguments? What's the 
>>point of having PerlIO layer at all?
>>
> 
> my interest in having an APR::File->open() was so we can pass in the
> args directly rather than jump through hoops to convert the perl sugar.
> it would end up calling apr_file_open exactly the same way the builtin
> open would.  but then again, you are implementing APR::PerlIO/PerlIO::APR
> not APR::File, so forget APR::File->open.


great!

While we are at it. I've placed the implementation into 
modperl_perlio.c|h and xs/APR/IO/APR_IO.h. Is that OK?



>>so the only thing it misses is $r|$s, which can be:
>>
>>   open my $fh, $r, ...
>>
> 
> that should be easy with modperl_sv2pool, right?


yup

 
>>I'm not sure how to handle the best the forwarding of any errors from 
>>APR's side to Perl side. I don't think it's possible to convert APR's 
>>errno into Perl's errno, without a *lot* of hassle. what's the best way 
>>to go?
>>
> 
> there is something in apr to get the errno out of apr_status_t,
> don't remember what it is though.


yes, there is, but the problem is translating errno from APR to Perl's 
errno. Perl's SETERRNO accepts special predefined errcode

perl-current/perl.h:#   define SETERRNO(errcode,vmserrcode) (errno = 
(errcode))

I guess I'll post soon the working protototype without handling the 
errors and then we will see what's the best way to handle the errors.

_____________________________________________________________________
Stas Bekman             JAm_pH      --   Just Another mod_perl Hacker
http://stason.org/      mod_perl Guide   http://perl.apache.org/guide
mailto:stas@stason.org  http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/


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


Mime
View raw message