mouse@mcgill-vision.UUCP (der Mouse) (09/11/88)
In article <235@longway.TIC.COM>, jsq@longway.TIC.COM (John S. Quarterman) writes: > In article <2364@pixar.UUCP> rta@pixar.UUCP (Rick Ace) writes: >> 3. Processes have direct handles (file descriptors) on terminals; >> they do not go indirect a job-common location. > The controlling terminal is associated with a process group, and > sends keyboard-generated signals like SIGHUP, SIGINT, and SIGQUIT to > processes in that process group. But -- surprise! -- under BSD at least, the controlling tty is not necessarily related to process group similarities. When someone types the interrupt character for a tty, a SIGINT signal is sent to all processes with a process group matching the process group of the tty. This is usually a subset of the set of processes whose controlling tty is the tty in question, but need not be related at all. > The controlling terminal is the one you get when you open /dev/tty. Close. When you open /dev/tty (BSD again), you get connected to a special device driver. I/O to this driver gets handed off to the driver of the controlling tty. What's the difference? Wellll.... - If you fstat() a file descriptor obtained by opening /dev/tty, you get the major and minor device numbers for /dev/tty rather than those for the controlling tty. - If you change controlling ttys, I/O to /dev/tty suddenly switches to the new controlling tty. (If you detach from the control tty and don't attach to some other tty, I/O to /dev/tty fails with ENXIO.) I'd like to see a device (/dev/ctltty maybe?) which, when opened, actually gave you a file descriptor as if you had opened the real control tty, thus providing the ability to avoid the above two points, if they cause problems for your application. (Of course, what we *really* need is a better notion of terminal lines. But I don't see that coming anytime soon - I certainly haven't anything "better" to suggest.) der Mouse old: mcgill-vision!mouse new: mouse@larry.mcrcim.mcgill.edu
jsq@longway.TIC.COM (John S. Quarterman) (09/12/88)
In article <1304@mcgill-vision.UUCP> mouse@mcgill-vision.UUCP (der Mouse) writes: >But -- surprise! -- under BSD at least, the controlling tty is not >necessarily related to process group similarities. Yes, I know. Details in my previous posting, except where specifically noted to be about a particular system, describe POSIX, not 4.3BSD or System V. At the moment, that is....