How to set control tty (Sys5)
Walter Mecky
walter at mecky.UUCP
Wed Jul 11 10:41:04 AEST 1990
In article <1990Jul06.015108.14622 at virtech.uucp> cpcahil at virtech.UUCP (Conor P. Cahill) writes:
< In article <483 at trux.UUCP> car at 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 at mecky or ...uunet!unido!mecky!walter ]
More information about the Comp.unix.wizards
mailing list