Xref: utzoo comp.lang.c:21336 comp.lang.c++:4512 Path: utzoo!utgpu!watmath!att!dptg!rutgers!gatech!ncar!ico!ism780c!haddock!karl From: karl@haddock.ima.isc.com (Karl Heuer) Newsgroups: comp.lang.c,comp.lang.c++ Subject: Re: ttyname() - question Message-ID: <14481@haddock.ima.isc.com> Date: 31 Aug 89 00:48:39 GMT References: <99@lkbpyr.UUCP> <1088@virtech.UUCP> Reply-To: karl@haddock.ima.isc.com (Karl Heuer) Organization: Interactive Systems, Cambridge, MA 02138-5302 Lines: 7 In article <1088@virtech.UUCP> cpcahil@virtech.UUCP (Conor P. Cahill) writes: >Of course if the user redirects all three, you're out of luck (unless you >open /dev/tty and then call ttyname() with the fd returned from the open). In which case you'll probably (depending on flavor) get the return string "/dev/tty" rather than the true name of the terminal. (Assuming the open succeeds in the first place. Not every process has a controlling terminal.)