Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!brutus.cs.uiuc.edu!jarthur!elroy.jpl.nasa.gov!jpl-devvax!lwall From: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Newsgroups: comp.lang.perl Subject: Re: ioctl() stops working with Patch 9-12 Message-ID: <7253@jpl-devvax.JPL.NASA.GOV> Date: 2 Mar 90 23:41:43 GMT References: <2969@uvaarpa.virginia.edu> Reply-To: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 30 In article <2969@uvaarpa.virginia.edu> worley@compass.com writes: : I just installed patch 9-12 and the following fragment of code has : stopped working: : : # set CBREAK, so we can read the responses from the shelltool to $queryiconified : do '/compass/c/worley/perl-3.0/ioctl.pl'; : $sgttyb_t = "ccccs"; # 4 chars and a short : if (ioctl(STDIN,$TIOCGETP,$sgttyb)) { : @ary = unpack($sgttyb_t,$sgttyb); : $ary[4] |= $CBREAK; : $sgttyb = pack($sgttyb_t,@ary); : ioctl(STDIN,$TIOCSETP,$sgttyb) : || die "Can't ioctl: $!"; : } : : The message I get is: : : Can't ioctl: Inappropriate ioctl for device at /compass/c/worley/bin/lpq.pl line 41. The problem has to do with the fact that Sun won't cast a negative float to an unsigned long. It used to just cast to a long, but that gave other machines heartburn. I'll see what I can do about it. In the meantime, try saying $TIOCSETP += 2**32 if $TIOCSETP < 0; It should only be necessary on ioctl()s that copy data into the kernel. Larry