File descriptor number disagreement

Peter Naulls peter at chocky.org
Wed Jun 8 11:16:05 PDT 2005


In message <42A72FD3.2030409 at sqrt.co.uk>
          Nick Burrett <nick at sqrt.co.uk> wrote:

> Peter Naulls 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?
> 
> Since file descriptors can be made arbitarily, it would probably be a 
> good idea i.e.
>    *program 254>&1
> 
> I wonder if there is any range checking to ensure that this fails:
>    *program 2393>&1

Yes, there is a check against __proc->maxfd in get_fd_redirection().

Whilst we're on the issue of redirection, there's some respawn thing in
Firefox (I don't know what the exact mechanism is) that occurs on an
upgrade, or initial run.  What ends up happening is that stderr/stdout
redirection isn't propogated, and they end up blatting the screen.  And
suggestions where I ought to be looking?

-- 
Peter Naulls - peter at chocky.org        | http://www.chocky.org/
----------------------------------------------------------------------------
Drobe - http://www.drobe.co.uk/        | The Premier RISC OS News Site



More information about the gcc mailing list