X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f X-Recipient: djgpp AT delorie DOT com Date: Sun, 05 Apr 2009 21:15:36 +0300 From: Eli Zaretskii Subject: Re: setmode In-reply-to: X-012-Sender: halo1 AT inter DOT net DOT il To: djgpp AT delorie DOT com Message-id: <83y6ufarw7.fsf@gnu.org> References: <83ljqgdchw DOT fsf AT gnu DOT org> <83bprccygw DOT fsf AT gnu DOT org> <83zlevbxki DOT fsf AT gnu DOT org> Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > From: "Rod Pemberton" > Date: Sun, 5 Apr 2009 05:04:12 -0400 > > "Eli Zaretskii" wrote in message > news:83zlevbxki DOT fsf AT gnu DOT org... > > > > Patches are welcome, of course. > > > > Unfortunately, I suspect that the "correct" fix for the problem is to > convert DJGPP to support a single stream mode exclusively, like many POSIX > environments having a binary mode but no text mode. E.g., for DJGPP, I'd > consider: > > 1) eliminating text streams from DJGPP by implementing all streams as > binary, e.g., setting stdin, stdout, stderr to binary via setmode() method > upon startup > 2) converting to a single character linefeed, e.g., LF only instead of CRLF, > for simpler code support of binary streams > 3) installing a RM int 0x29 routine as part of execution startup which > will convert LF's to CRLF's for display, but not for file redirection > > I'm sure that is far beyond what you had in mind... Far beyond, because I don't see any need for this complexity. All that's needed is a single call to `dup' or `dup2' to copy the existing handle.