Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!elroy.jpl.nasa.gov!jpl-devvax!lwall From: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Newsgroups: comp.lang.perl Subject: Re: How do I detach from control terminal? Message-ID: <9041@jpl-devvax.JPL.NASA.GOV> Date: 7 Aug 90 00:30:14 GMT References: <1990Aug6.190050.2706@csrd.uiuc.edu> Reply-To: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Distribution: comp Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 25 In article <1990Aug6.190050.2706@csrd.uiuc.edu> kai@sp1.csrd.uiuc.edu (Kuck And Associates) writes: : I've written in Perl the equivalent of the C code I have used : in a daemon to detach from the control terminal, but it doesn't : seem to work (on a BSD Unix host). : : Can anyone tell me what I'm doing wrong in this example? : do "sys/ioctl.h"; # probably /usr/local/lib/perl/sys/ioctl.h : if ($@ ne "") { : print STDERR "check_uptime: cannot \"do sys/ioctl.h\": $@\n"; : print STDERR "you probably need to run \"makelib sys/ioctl.h\"\n"; : exit (1); : } : ioctl (TTY, $TIOCNOTTY, 0); That should probably be &TIOCNOTTY. After the next patch, you'll want to turn those lines into require "sys/ioctl.ph"; ioctl(TTY, &TIOCNOTTY, 0); Note the .ph extension change also. Larry