cannot open null: for I/O redirection

John Tytgat John.Tytgat at
Sun Oct 12 14:28:18 PDT 2003

In message <4c3f54c42asbellon at>
          Stefan Bellon <sbellon at> wrote:

> I found something strange in UnixLib. When using
> __RISCOSIFY_NO_PROCESS, then I'd expect the program linked against
> UnixLib to handle native RISC OS file names.
> If I do:
> *myapp > null:
> it works. However, if I do:
> *myapp < null:
> then I get "cannot open null: for I/O redirection". If I however do:
> *myapp < /dev/null
> then that works again. But I'd expect "null:" to work.
> What's puzzling me is the fact that "null:" as stdout works but not as
> stdin.

The reason is that the "null:" gets handled by __fsopen() (the standard
RISC OS open() implementation) and that's not 100% suited for real
/dev/null behaviour.  We do however have a proper /dev/null open()
implementation (i.e. __nullopen()) and this routine gets now selected
by the patch I've just commited in CVS.

John Tytgat, in his comfy chair at home                                 BASS
John.Tytgat at                             ARM powered, RISC OS driven

More information about the gcc mailing list