Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84 SMI; site sun.uucp Path: utzoo!linus!decvax!decwrl!sun!guy From: guy@sun.uucp (Guy Harris) Newsgroups: net.unix-wizards Subject: Re: reassigning a control terminal Message-ID: <2889@sun.uucp> Date: Sat, 12-Oct-85 20:05:14 EDT Article-I.D.: sun.2889 Posted: Sat Oct 12 20:05:14 1985 Date-Received: Tue, 15-Oct-85 07:19:05 EDT References: <385@bocklin.UUCP> Distribution: net Organization: Sun Microsystems, Inc. Lines: 13 > Is there any way to reassign the control terminal associated with a > process that has been forked from a process to which a control ter- > minal is associated? That is, can I get a forked process to change > the device associated with /dev/tty? We are running 4.2bsd. There is an (undocumented, mumble bitch grumble) "ioctl" call that permits a process which has a control terminal to detach itself from that control terminal. You open "/dev/tty" (if it fails, there's no control terminal to detach yourself from) and do a TIOCNOTTY "ioctl" call (it takes no parameters). The next terminal that process opens will become its control terminal. Guy Harris