Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!rutgers!seismo!mcvax!ukc!warwick!cudcv From: cudcv@warwick.UUCP Newsgroups: comp.unix.wizards Subject: Re: how do I make a process release its terminal? Message-ID: <323@sol.warwick.ac.uk> Date: Wed, 28-Jan-87 08:08:46 EST Article-I.D.: sol.323 Posted: Wed Jan 28 08:08:46 1987 Date-Received: Sun, 1-Feb-87 16:08:02 EST References: <118@lmi-angel.UUCP> Reply-To: cudcv@sol.warwick.ac.uk (Rob McMahon) Distribution: world Organization: Computing Services, Warwick University, UK Lines: 36 In article <118@lmi-angel.UUCP> wsr@lmi-angel.UUCP (Wolfgang Rupprecht) writes: |In article <> paul@vixie.UUCP (Paul Vixie Esq) writes: |>I see that syslogd, inetd, cron, and the rest do NOT show 'co' as their |>control terminal; how do I make this happen for me? | |try this: | |#include | |fromlimbo () |{ | int f; | | if ((f = open ("/dev/tty", 2)) >= 0) | { | ioctl (f, TIOCNOTTY, 0); | close (f); | } | else | perror ("open"); |} |-- |Wolfgang Rupprecht {harvard|decvax!cca|mit-eddie}!lmi-angel!wsr I would have thought the 'else perror(...);' was undesirable. If you can't open /dev/tty it probably means you're already without a controlling terminal and the ioctl is simply unecessary. Don't you want a setpgrp(getpid()); after that, too, to fully dissociate it from the terminal (otherwise when you hit ^C, you'll still get the signal). -- UUCP: ...!mcvax!ukc!warwick!cudcv PHONE: +44 203 523037 JANET: cudcv@uk.ac.warwick.daisy ARPA: cudcv@daisy.warwick.ac.uk Rob McMahon, Computing Services, Warwick University, Coventry CV4 7AL, England