Mail Archives: djgpp/2001/01/01/11:21:36
In article <Pine DOT SUN DOT 3 DOT 91 DOT 1010101162145 DOT 9706D-100000 AT is>,
Eli Zaretskii <djgpp AT delorie DOT com> wrote:
>
>Which one? There's no mnemonic for such problems in any other
>DOS/Windows compiler I know about. And Unix compilers don't know
>anything about this brain damage either.
>
>ENOSPC is returned because the console device refuses to take any more
>data (the _write primitive tries twice before it gives up).
...
>The program can know that it writes to a console device: it just needs to
>call isatty() on the handle. It can also filter out ^Z characters if
>stdout is connected to the console. Finally, it can remove trailing ^Z
>from input after it reads it. (Such removal will happen automatically if
>the input is read in text mode.)
>
>Would that solve the problem?
Well, does not djgpp claim to be an environment which makes it easy to
port Unix programs to DOS (even at the expense of doing a lot of
contortions to implement stat accurately, for instance)? I claim that in
the same way it should be the job of the libc low-level routines to
detect that the output is to a console device, and do the appropriate
thing (filter ^Z, whatever) so that no spurious error is returned, and
that more programs can be ported painlessly.
Best regards,
Jean MICHEL
- Raw text -