File descriptor number disagreement

Peter Naulls peter at chocky.org
Wed Jun 8 12:13:35 PDT 2005


In message <a1f1ed774d.ajw498 at caramel.cp15.org>
          Alex Waugh <alex at alexwaugh.com> wrote:

> In message <21d4dc774d.peter at chocky.org>
>           Peter Naulls <peter at chocky.org> wrote:
> 
> > 
> > FD_BITS in UnixLib is 256, yet SUL only allocates room for 54 file
> > descriptors.  This causes potential badness in select(), although
> > possibly nowhere else.
> > 
> > The obvious fix it to make a new SUL verision which allocates more.  Any
> > comments?
> 
> The size of the __proc->file_descriptors array can in theory be
> increased dynamically by UnixLib when the program runs out of file
> descriptors, and existing code and SUL should cope. I don't know if
> that helps with the select problem though.

Probably not.  We have UnixLib code, and code using UL headers presuming
256.  I think the only practical solution without shared libraries is a
newer SUL that addresses this.  Of course, if you increase the number of
file descriptions, you would have to make FD_BITS a macro, but that
might break things too.  

-- 
Peter Naulls - peter at chocky.org        | http://www.chocky.org/
----------------------------------------------------------------------------
Please Reply Properly                  | http://www.riscos.info/posting/



More information about the gcc mailing list