Path: utzoo!attcan!uunet!mcsun!unido!mikros!mwtech!mecky!walter From: walter@mecky.UUCP (Walter Mecky) Newsgroups: comp.unix.wizards Subject: Re: How to set control tty (Sys5) Message-ID: <689@mecky.UUCP> Date: 11 Jul 90 00:41:04 GMT References: <483@trux.UUCP> <1990Jul06.015108.14622@virtech.uucp> Reply-To: walter@mecky.UUCP (Walter Mecky) Organization: MIKROS Systemware, Buettelborn/W-Germany Lines: 24 In article <1990Jul06.015108.14622@virtech.uucp> cpcahil@virtech.UUCP (Conor P. Cahill) writes: < In article <483@trux.UUCP> car@trux.UUCP (Chris Rende) writes: < >However, I can't figure/find out how to set the control tty. I read in < >TERMIO(7) something like "The first terminal file that gets opened becomes < >the control terminal". When I wrote a program that disassociates itself from < >the control terminal and then does a "fd=open("/dev/ttyi00",O_RDWR);" < >it didn't work. I.e, a "ps -ef" shows "?" for the control tty. < < The other requirement is that no other proces has that terminal as its < controlling terminal. I would guess that your test is failing because < the tty is the controlling terminal for another process. The third requirement is that the proces is a process group leader. According to my manual from SCO UNIX 3.2: The very first terminal file opened by the process group leader of a terminal file not already associated with a process group becomes the for that process group. The control terminal plays a special role in handling quit and interrupt signals, as discussed below. The control terminal is inherited by a child process during a fork(S). A process can break this association by changing its process group using setpgrp(S). -- Walter Mecky [ walter@mecky or ...uunet!unido!mecky!walter ]