Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!ukc!stl!crosfield!ir From: ir@crosfield.co.uk (ian reid) Newsgroups: comp.unix.questions Subject: Why does a process have to have a tty open for stty to work (SysV) Keywords: tty stty open SysV Message-ID: <8845@suns302.crosfield.co.uk> Date: 27 Feb 91 11:11:26 GMT Organization: Crosfield Ltd., Hemel Hempstead, United Kingdom Lines: 32 On all the System V machines I have worked on, I'm not sure about BSD flavours, if you wish to change the settings of a tty line using stty that tty line had to be opened by a process for the changes to take effect. I have come across this most recently when trying to setup COM3 on a PC running Interactive UNIX 2.2, to send debugging output to a VT100 terminal. No gettys or any other process are running on COM3. COM3 is /dev/tty01 So the following sequence occurs. prompt> stty < /dev/tty01 speed 300 baud; prompt> stty 9600 < /dev/tty01 prompt> stty < /dev/tty01 speed 300 baud; prompt> sleep 1000 > /dev/tty01& prompt> stty 9600 < /dev/tty01 prompt> stty < /dev/tty01 speed 9600 baud; Of course another interesting thing is stty works on the standard input for SysV systems, but on the standard output for BSD systems. So why does another process have to have the tty device open for the changes to work, and why the difference described in the previous paragraph between different stty implementations. -- Ian Reid #include UUCP: ir@cel.uucp or ir@cel.co.uk or ...!{ukc,mcsun,uunet}!cel!ir "Computers..proof positive that no-one yet understands how to describe any real world situation in 0's and 1's."