delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1997/09/08/19:00:34

Message-Id: <199709082300.TAA01560@delorie.com>
From: Oberhumer Markus <k3040e4 AT c210 DOT edvz DOT uni-linz DOT ac DOT at>
Subject: Re: stdin + binmode (yet another one ;-)
To: eliz AT is DOT elta DOT co DOT il (Eli Zaretskii)
Date: Tue, 9 Sep 1997 00:54:23 +0200 (METDST)
Cc: k3040e4 AT c210 DOT edvz DOT uni-linz DOT ac DOT at, djgpp-workers AT delorie DOT com
In-Reply-To: <Pine.SUN.3.91.970904204152.27525L-100000@is> from "Eli Zaretskii" at Sep 4, 97 08:42:34 pm
Return-Read-To: markus DOT oberhumer AT jk DOT uni-linz DOT ac DOT at
Mime-Version: 1.0

> I'm not saying I oppose your suggestion too strongly, but let me just
> be the Devil's advocate here, so this issue doesn't look too one-sided,
> OK?

Binary mode IO is used for 2 different purposes:

A) disabling the translation of textmode characters (CR/NL etc.)
B) talking to devices in "raw" mode

For some reason B) was introduced in 2.01 as a default when opening
stdin. There was probably not much discussion at this time...

> Don't forget that termios is with us only beginning with last 2.01
> beta releases, and it is incomplete, whereas the Ctrl-C disable was
> there in v2 from day one.  You will need to convert all programs that
> want to see Ctrl-C to termios before you could remove that.

If you want to disable Ctrl-C you should have to make an explicit call
to termios or use signal(SIGINT,SIG_IGN) - this is completly portable.
Doing this automatically as side-effect of open() and setmode() is just
different from all systems I know - and I think it's wrong.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019