Mail Archives: djgpp-workers/2002/01/12/02:59:46
> From: "Tim Van Holder" <tim DOT van DOT holder AT pandora DOT be>
> Date: Fri, 11 Jan 2002 20:45:30 +0100
>
> A bigger problem is that several Unix-born programs assume handles 0, 1,
> 2 to be the standard streams (in the best case, they use STDOUT_FILENO
> or similar macros, but it biols down to the same assumption).
> To cater for that, we could just ensure fd's 0-4 are always opened
> (so user-space fd's would be 5 and up), e.g. by opening NUL when one
> of them is closed at startup. Do we control the FD, or do we just
> have to make do with what DOS gives us?
If those handles are open, we should not change them, of course. If
they are _not_ open, we could do anything we reasonably want to.
However, I'm not sure we indeed should open those handles, just make
them invalid, so any code that uses them will fail. Some program
could actually close those handles to gain more handles, for example;
IMHO we shouldn't defeat such code unless we absolutely have to.
- Raw text -