Path: utzoo!censor!geac!torsqnt!lethe!yunexus!ists!helios.physics.utoronto.ca!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!rpi!uupsi!cmcl2!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.unix.questions Subject: Re: Why does a process have to have a tty open for stty to work (SysV) Message-ID: <15358@smoke.brl.mil> Date: 28 Feb 91 17:02:03 GMT References: <8845@suns302.crosfield.co.uk> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 21 In article jim@cs.strath.ac.uk (Jim Reid) writes: >The difference in implementations is System V's doing. The BSD stty >command works in the same way that its predecessors like V7 worked. >When AT&T cleaned up their tty driver, they changed the behaviour of >stty. I disagree with this summary of the history. I seem to recall that PWB "stty", certainly UNIX System III "stty", shared this aspect of the current "stty" behavior. >I suspect the reasoning was to allow the text output of an stty >command to be redirected to a file or down a pipe. Exactly. This is quite useful at times. >IMHO, this is wrong since intuitively stty `writes' an ioctl to the >terminal, and it's not good practice to write on the standard input. The use of TCGETA amounts to a "read", not a "write". If you change the terminal handler settings via TCSETAW, then that amounts to a "write". "stty" has both uses.