apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: the issue with apr_generate_random_bytes
Date Fri, 21 Mar 2003 02:21:34 GMT
Branko ─îibej wrote:
> Stas Bekman wrote:
>>Hmm, now I see why apr_generate_random_bytes is not exported on AIX.
>>For some reason I was checking apr.exp on linux and thought it was
>>just a bug in older apr versions that apr_generate_random_bytes wasn't
>>exported. my bad. So we have:
>>APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char * buf,
>>                                                    apr_size_t length);
>>I thought that apr_ namespace includes only functions available on all
>>supported platforms. Is that a wrong assumption? 
> Yup. There's no apr_fork on Windows, for instance.

mod_perl's APR Perl API doesn't provides a glue for this one, because perl 
already provides fork() which works on all platforms, including win32.

>>it looks that one of the linking problems that I had with libapr was
>>due to this issue. one of the mod_perl libs provided a perl glue for
>>this function, but the function wasn't available on AIX.
>>How this situation should be handled? Should we drop the provision of
>>the perl glue for this function, as it might be unavailable? 
> I'd say that's mod_perl's problem. It should check APR_HAS_RANDOM.

It is, I just wasn't aware of it till I started to port mod_perl build on AIX. 
That's what happening when you develop and test things on a platform which 
happens to support everything (linux) ;)

>>Are there other apr_ functions that are subject to availability? 
> Off the top ot my head: APR_HAS_FORK, APR_HAS_THREADS. Possibly others.

APR_HAS_THREADS is a bit different, since it's needed to support the threaded 
mpms. So we do check for it.

However in the case of APR_HAS_RANDOM we will simply drop 
apr_generate_random_bytes from the APR:: Perl API, because mod_perl code 
should work everywhere unconditionally, just like Perl does. A true write once 
run anywhere ;)

Thank you Branko!

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

View raw message