Path: utzoo!utgpu!water!watmath!clyde!cbosgd!mandrill!hal!ncoast!allbery From: allbery@ncoast.UUCP (Brandon Allbery) Newsgroups: comp.unix.wizards Subject: Re: /dev/tty doesn't exist? Message-ID: <6955@ncoast.UUCP> Date: 6 Jan 88 00:40:30 GMT References: <445@minya.UUCP> <243@jc3b21.UUCP> Reply-To: allbery@ncoast.UUCP (Brandon Allbery) Followup-To: comp.unix.wizards Organization: Cleveland Public Access UN*X, Cleveland, Oh Lines: 26 As quoted from <243@jc3b21.UUCP> by jra@jc3b21.UUCP (Jay R. Ashworth): +--------------- | In article <445@minya.UUCP>, jc@minya.UUCP (John Chambers) says: | > Some hints: This is a rather generic Unix Sys/V.2, so the problem should | > be similar to most ATT Unices. The most unusual thing about how X is run | > is that it isn't being started by a login shell; it is started as a daemon | > by init, and in some cases, decides to grab a terminal (whose name is on | Aha. As I understand the way these things work, and I'm sure someone | will clarify what I'm about to say :-), /dev/tty is set by the kernel | to point to the control terminal of a process group. Background | process, those running as daemons, have no control terminal. Look at +--------------- /dev/tty is more of an alias than a device. A function call on /dev/tty looks up in the user block of the process to determine the controlling terminal, then repeats the function call on that terminal. If there is no controlling terminal, an open on /dev/tty will fail because the /dev/tty open routine can't figure out what tty's open routine to call. In particular, /dev/tty does not work at all like the /dev/window device on the 3B1, which searches for the first UNUSED window device rather than the current one. -- Brandon S. Allbery, Moderator of comp.sources.misc {hoptoad,harvard!necntc,cbosgd,sun!mandrill!hal,uunet!hnsurg3}!ncoast!allbery PS/2: Half a computer. OS/2: Half an operating system for half a computer.