Path: utzoo!attcan!uunet!lll-winken!lll-tis!mordor!joyce!ames!ucsd!ucsdhub!hp-sdd!ncr-sd!ncrlnk!ncrcce!mercer From: mercer@ncrcce.StPaul.NCR.COM (Dan Mercer) Newsgroups: comp.lang.c Subject: Re: Getchar w/wout echo Summary: Why not?!!! Message-ID: <743@ncrcce.StPaul.NCR.COM> Date: 12 Sep 88 21:20:41 GMT References: <733@ncrcce.StPaul.NCR.COM: <7070@cdis-1.uucp: <739@ncrcce.StPaul.NCR.COM: <7196@haddock.ima.isc.com: Reply-To: mercer@ncrcce.StPaul.NCR.COM (Dan Mercer) Organization: NCR Comten, Inc. Lines: 41 In article <7196@haddock.ima.isc.com: karl@haddock.ima.isc.com (Karl Heuer) writes: :mercer@ncrcce.StPaul.NCR.COM (Dan Mercer) writes: ::To expect portability across different hardware and operating system ::architectures, however, just because you write in 'C', stretches the meaning ::of portability. One shouldn't expect the programming language to usurp the ::role of an operating system, or expect the interface of the language to the ::operating system to be the same in all instances. : :Why not? That's exactly what stdio does, for example. And several other :system functions (rename(), remove()) are now part of the standard library :which must be provided with every ANSI C implementation. : :On the other hand, fork() is not and should not be part of ANSI C. So I think :the real question is whether it's *possible* to standardize a reasonable form :of raw I/O interface. If so, I don't see any obvious reason not to do it. : :Karl W. Z. Heuer (ima!haddock!karl or karl@haddock.isc.com), The Walking Lint Why not? Why not!! Because character echo is a function of the output device, not part of the character stream, and the output device is part of the operating system, not the language. Stdio's job is to format, input and output the character stream, not to control the device. Controlling echo is meaningless to non display input devices (like hard disks). To mutilate stdio to know the type of input device it is getting the stream from is a violation. And in systems with distributed processing (like NCR Towers, where ioctl takes place in the HPSIO processor, or LAN's, where the ioctl may be distributed to the work stations) it isn't practical (what are you going to do, send out change ioctl commands with every character input). Why don't you just find out how on your machine you turn off echo and roll your own programs to do stdio. For your programs to be portable across different hardware schemes, and different operating systems, you'll just have to do what the rest of us do - write code to port them. Dan Mercer NCR Comten