develooper Front page | perl.perl5.porters | Postings from September 2009

Re: Perl select() and fd_set differences

Thread Previous | Thread Next
Nicholas Clark
September 24, 2009 02:02
Re: Perl select() and fd_set differences
Message ID:
On Thu, Sep 24, 2009 at 12:45:52PM +1000, NormW wrote:
> Hi all,
> Trying to port the ASSP app to NetWare, and found that NetWare has an 
> fd_set typedef somewhat different to most:
> >typedef struct fd_set
> >{
> >   int   fd_count;
> >   int   fd_array[FD_SETSIZE];
> >} fd_set;
> >
> where fd_count is the numeric size of the active portion of the fd_array 
> for both input and output. It does have the FD_CLR, FD_SET, FD_ZERO and 
> FD_ISSET macro's.
> AFAICT this is a 'different' approach to that used by Perl pp_sselect(), 
> (pp_sys.c) which uses a bit-map vector method.

However IO::Select is implemented using the builtin select, with parameters
conforming to its interface documented in perlfunc.pod, so ultimately it is
just calling down into pp_sselect

> Can anyone suggest what changes are needed to get IO::Select working 
> with this 'fd_set' structure on Perl (5.8.9)? Any assistance would be 
> much appreciated, and a working diff will be made available if I can get 
> it working.

I'd suggest adding conditionally compiled code to pp_sselect to map from the
interface that Perl-space expects into the structures that NetWare requires.

I assume that this will need 3 local structures, and some size-constrained

Nicholas Clark

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About