apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan Bloom <...@covalent.net>
Subject Re: missing a method to access file descriptor
Date Fri, 30 Nov 2001 14:55:26 GMT
On Friday 30 November 2001 01:12 am, Stas Bekman wrote:
> I'm implementing a PerlIO::APR layer to transparently work with
> apr_file_t * from Perl. I must implement Perl_fileno() which returns a
> file descriptor (int on unix or its alternatives) which can be then fed
> into fstat(2) on unix or the alt function on other platforms.
>
> Currently APR doesn't expose filedesc struct member, I suppose mostly
> due to the fact that not all supported platforms use the same form of
> filedesc. I see that os2 and win are different from netware and unix.
>
> Is it possible to expose something like apr_fileno which will return its
> appropriate filehandle/fd?

Use apr_os_file_get.  This will work on Unix, but Windows and OS/2 will
return to OS specific handle.  For those, you will need OS specific code
to convert it to a filedes.

Ryan

______________________________________________________________
Ryan Bloom				rbb@apache.org
Covalent Technologies			rbb@covalent.net
--------------------------------------------------------------

Mime
View raw message