Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!uhccux!munnari.oz.au!bruce!goanna!chudich!rcodi From: rcodi@chudich.co.rmit.oz (Ian Donaldson) Newsgroups: comp.unix.wizards Subject: Re: 4.3 BSD and getting rid of control tty Message-ID: <696@chudich.co.rmit.oz> Date: 9 Sep 89 01:46:12 GMT References: <15412@dartvax.Dartmouth.EDU> <3058@mace.cc.purdue.edu> Organization: RMIT Comm & Elec Eng, Melbourne, Australia. Lines: 24 abe@mace.cc.purdue.edu (Vic Abell) writes: >In article <15412@dartvax.Dartmouth.EDU>, ericb@libdev.dartmouth.edu (Eric Bivona) writes: > about disassociating from a /dev/tty whose control terminal is > no longer open. >I reported this problem to Berkeley some time ago - ca. October, 1988. >My solution is to use a SIGALRM around the open of /dev/tty. It avoids >a kernel hack. An almost equivalent operation is: setpgrp(0, 0); It has the effect that no signals will be sent to your process anymore from terminals, even though your process is still logically associated with a tty (as far as /bin/ps shows), and it also has the effect that the next tty you open becomes your controlling tty. TIOCNOTTY only has one advantage over this: it removes the association with the original tty. This is rarely noticed. It also has the disadvantage that you noted... blocking if the tty is no longer open by any process (and it waits for carrier). Ian D